From f5a1d5d073009a4c7d6948675e039488a205dcd9 Mon Sep 17 00:00:00 2001 From: Deepak Rajendran Date: Mon, 7 Nov 2016 15:01:11 -0800 Subject: [PATCH 1/6] update description, new autorest and vnet get --- .../ApplicationGatewaysOperations.cs | 851 +++++----- ...ApplicationGatewaysOperationsExtensions.cs | 185 +-- ...essRouteCircuitAuthorizationsOperations.cs | 466 +++--- ...rcuitAuthorizationsOperationsExtensions.cs | 105 +- .../ExpressRouteCircuitPeeringsOperations.cs | 466 +++--- ...outeCircuitPeeringsOperationsExtensions.cs | 105 +- .../ExpressRouteCircuitsOperations.cs | 1091 +++++++------ ...xpressRouteCircuitsOperationsExtensions.cs | 265 ++- .../ExpressRouteServiceProvidersOperations.cs | 164 +- ...uteServiceProvidersOperationsExtensions.cs | 35 +- .../IApplicationGatewaysOperations.cs | 216 ++- ...essRouteCircuitAuthorizationsOperations.cs | 113 +- .../IExpressRouteCircuitPeeringsOperations.cs | 115 +- .../IExpressRouteCircuitsOperations.cs | 283 +++- ...IExpressRouteServiceProvidersOperations.cs | 36 +- .../Generated/ILoadBalancersOperations.cs | 144 +- .../ILocalNetworkGatewaysOperations.cs | 113 +- .../Generated/INetworkInterfacesOperations.cs | 268 ++- .../Generated/INetworkManagementClient.cs | 28 +- .../INetworkSecurityGroupsOperations.cs | 140 +- .../Generated/IPublicIpAddressesOperations.cs | 140 +- .../Generated/IRouteTablesOperations.cs | 128 +- .../Generated/IRoutesOperations.cs | 104 +- .../Generated/ISecurityRulesOperations.cs | 110 +- .../Generated/ISubnetsOperations.cs | 104 +- .../Generated/IUsagesOperations.cs | 32 +- ...tualNetworkGatewayConnectionsOperations.cs | 173 +- .../IVirtualNetworkGatewaysOperations.cs | 174 +- .../IVirtualNetworkPeeringsOperations.cs | 108 +- .../Generated/IVirtualNetworksOperations.cs | 151 +- .../Generated/LoadBalancersOperations.cs | 598 +++---- .../LoadBalancersOperationsExtensions.cs | 133 +- .../LocalNetworkGatewaysOperations.cs | 448 ++--- ...ocalNetworkGatewaysOperationsExtensions.cs | 101 +- .../Generated/Models/AddressSpace.cs | 22 +- .../Generated/Models/ApplicationGateway.cs | 177 +- ...icationGatewayAuthenticationCertificate.cs | 45 +- .../ApplicationGatewayBackendAddress.cs | 20 +- .../ApplicationGatewayBackendAddressPool.cs | 57 +- .../Models/ApplicationGatewayBackendHealth.cs | 16 +- ...icationGatewayBackendHealthHttpSettings.cs | 28 +- .../ApplicationGatewayBackendHealthPool.cs | 28 +- .../ApplicationGatewayBackendHealthServer.cs | 29 +- ...icationGatewayBackendHealthServerHealth.cs | 9 +- .../ApplicationGatewayBackendHttpSettings.cs | 89 +- .../ApplicationGatewayCookieBasedAffinity.cs | 5 +- .../Models/ApplicationGatewayFirewallMode.cs | 5 +- ...plicationGatewayFrontendIpConfiguration.cs | 67 +- .../Models/ApplicationGatewayFrontendPort.cs | 44 +- .../Models/ApplicationGatewayHttpListener.cs | 83 +- .../ApplicationGatewayIpConfiguration.cs | 49 +- .../ApplicationGatewayOperationalState.cs | 5 +- .../Models/ApplicationGatewayPathRule.cs | 59 +- .../Models/ApplicationGatewayProbe.cs | 89 +- .../Models/ApplicationGatewayProtocol.cs | 5 +- .../ApplicationGatewayRequestRoutingRule.cs | 74 +- ...pplicationGatewayRequestRoutingRuleType.cs | 5 +- .../Generated/Models/ApplicationGatewaySku.cs | 36 +- .../Models/ApplicationGatewaySkuName.cs | 5 +- .../ApplicationGatewaySslCertificate.cs | 61 +- .../Models/ApplicationGatewaySslPolicy.cs | 22 +- .../Models/ApplicationGatewaySslProtocol.cs | 5 +- .../Models/ApplicationGatewayTier.cs | 5 +- .../Models/ApplicationGatewayUrlPathMap.cs | 63 +- ...ewayWebApplicationFirewallConfiguration.cs | 29 +- .../Models/AuthorizationUseStatus.cs | 5 +- .../Models/AzureAsyncOperationResult.cs | 20 +- .../Generated/Models/BackendAddressPool.cs | 62 +- .../Generated/Models/BgpSettings.cs | 25 +- .../Models/ConnectionResetSharedKey.cs | 25 +- .../Generated/Models/ConnectionSharedKey.cs | 23 +- .../Generated/Models/DhcpOptions.cs | 22 +- .../Models/DnsNameAvailabilityResult.cs | 15 +- .../Models/EffectiveNetworkSecurityGroup.cs | 28 +- ...ffectiveNetworkSecurityGroupAssociation.cs | 21 +- ...EffectiveNetworkSecurityGroupListResult.cs | 26 +- .../Models/EffectiveNetworkSecurityRule.cs | 94 +- .../Generated/Models/EffectiveRoute.cs | 66 +- .../Models/EffectiveRouteListResult.cs | 25 +- .../Generated/Models/EffectiveRouteSource.cs | 5 +- .../Generated/Models/EffectiveRouteState.cs | 5 +- .../Generated/Models/Error.cs | 22 +- .../Generated/Models/ErrorDetails.cs | 14 +- .../Generated/Models/ExpressRouteCircuit.cs | 99 +- .../Models/ExpressRouteCircuitArpTable.cs | 30 +- .../ExpressRouteCircuitAuthorization.cs | 52 +- .../Models/ExpressRouteCircuitPeering.cs | 122 +- ...rcuitPeeringAdvertisedPublicPrefixState.cs | 5 +- .../ExpressRouteCircuitPeeringConfig.cs | 46 +- .../Models/ExpressRouteCircuitPeeringState.cs | 5 +- .../Models/ExpressRouteCircuitPeeringType.cs | 5 +- .../Models/ExpressRouteCircuitRoutesTable.cs | 33 +- .../ExpressRouteCircuitRoutesTableSummary.cs | 43 +- ...ssRouteCircuitServiceProviderProperties.cs | 25 +- .../Models/ExpressRouteCircuitSku.cs | 32 +- .../Models/ExpressRouteCircuitSkuFamily.cs | 5 +- .../Models/ExpressRouteCircuitSkuTier.cs | 5 +- .../Models/ExpressRouteCircuitStats.cs | 23 +- .../ExpressRouteCircuitsArpTableListResult.cs | 25 +- ...pressRouteCircuitsRoutesTableListResult.cs | 25 +- ...uteCircuitsRoutesTableSummaryListResult.cs | 25 +- .../Models/ExpressRouteServiceProvider.cs | 40 +- ...ssRouteServiceProviderBandwidthsOffered.cs | 20 +- .../Models/FrontendIpConfiguration.cs | 100 +- .../Models/IPAddressAvailabilityResult.cs | 27 +- .../Generated/Models/IPConfiguration.cs | 64 +- .../Generated/Models/IPVersion.cs | 5 +- .../Generated/Models/InboundNatPool.cs | 101 +- .../Generated/Models/InboundNatRule.cs | 117 +- .../Generated/Models/IpAllocationMethod.cs | 5 +- .../Generated/Models/LoadBalancer.cs | 127 +- .../Generated/Models/LoadBalancingRule.cs | 141 +- .../Generated/Models/LoadDistribution.cs | 5 +- .../Generated/Models/LocalNetworkGateway.cs | 67 +- .../Generated/Models/NetworkInterface.cs | 96 +- .../Models/NetworkInterfaceDnsSettings.cs | 67 +- .../Models/NetworkInterfaceIpConfiguration.cs | 94 +- .../Models/NetworkOperationStatus.cs | 5 +- .../Generated/Models/NetworkSecurityGroup.cs | 77 +- .../Generated/Models/OutboundNatRule.cs | 69 +- .../Generated/Models/Page.cs | 22 +- .../Generated/Models/Probe.cs | 103 +- .../Generated/Models/ProbeProtocol.cs | 5 +- .../Generated/Models/ProcessorArchitecture.cs | 5 +- .../Generated/Models/PublicIpAddress.cs | 79 +- .../Models/PublicIpAddressDnsSettings.cs | 44 +- .../Generated/Models/Resource.cs | 39 +- .../Models/ResourceNavigationLink.cs | 47 +- .../Generated/Models/Route.cs | 65 +- .../Generated/Models/RouteNextHopType.cs | 5 +- .../Generated/Models/RouteTable.cs | 49 +- .../Generated/Models/SecurityRule.cs | 147 +- .../Generated/Models/SecurityRuleAccess.cs | 5 +- .../Generated/Models/SecurityRuleDirection.cs | 5 +- .../Generated/Models/SecurityRuleProtocol.cs | 5 +- .../ServiceProviderProvisioningState.cs | 5 +- .../Generated/Models/SubResource.cs | 15 +- .../Generated/Models/Subnet.cs | 72 +- .../Generated/Models/TransportProtocol.cs | 5 +- .../Models/TunnelConnectionHealth.cs | 38 +- .../Generated/Models/Usage.cs | 30 +- .../Generated/Models/UsageName.cs | 17 +- .../Generated/Models/VirtualNetwork.cs | 74 +- .../Generated/Models/VirtualNetworkGateway.cs | 115 +- .../Models/VirtualNetworkGatewayConnection.cs | 125 +- .../VirtualNetworkGatewayConnectionStatus.cs | 5 +- .../VirtualNetworkGatewayConnectionType.cs | 5 +- .../VirtualNetworkGatewayIpConfiguration.cs | 69 +- .../Models/VirtualNetworkGatewaySku.cs | 44 +- .../Models/VirtualNetworkGatewaySkuName.cs | 5 +- .../Models/VirtualNetworkGatewaySkuTier.cs | 5 +- .../Models/VirtualNetworkGatewayType.cs | 5 +- .../Generated/Models/VirtualNetworkPeering.cs | 86 +- .../Models/VirtualNetworkPeeringState.cs | 5 +- .../Models/VpnClientConfiguration.cs | 37 +- .../Generated/Models/VpnClientParameters.cs | 24 +- .../Models/VpnClientRevokedCertificate.cs | 46 +- .../Models/VpnClientRootCertificate.cs | 50 +- .../Generated/Models/VpnType.cs | 5 +- .../Generated/NetworkInterfacesOperations.cs | 1176 ++++++++------ .../NetworkInterfacesOperationsExtensions.cs | 219 ++- .../Generated/NetworkManagementClient.cs | 216 +-- .../NetworkManagementClientExtensions.cs | 19 +- .../NetworkSecurityGroupsOperations.cs | 596 +++---- ...tworkSecurityGroupsOperationsExtensions.cs | 129 +- .../Generated/PublicIpAddressesOperations.cs | 594 +++---- .../PublicIpAddressesOperationsExtensions.cs | 125 +- .../Generated/RouteTablesOperations.cs | 586 ++++--- .../RouteTablesOperationsExtensions.cs | 109 +- .../Generated/RoutesOperations.cs | 458 +++--- .../Generated/RoutesOperationsExtensions.cs | 89 +- .../Generated/SecurityRulesOperations.cs | 462 +++--- .../SecurityRulesOperationsExtensions.cs | 97 +- .../Generated/SubnetsOperations.cs | 459 +++--- .../Generated/SubnetsOperationsExtensions.cs | 87 +- .../Generated/UsagesOperations.cs | 166 +- .../Generated/UsagesOperationsExtensions.cs | 27 +- ...tualNetworkGatewayConnectionsOperations.cs | 728 +++++---- ...kGatewayConnectionsOperationsExtensions.cs | 135 +- .../VirtualNetworkGatewaysOperations.cs | 651 ++++---- ...tualNetworkGatewaysOperationsExtensions.cs | 167 +- .../VirtualNetworkPeeringsOperations.cs | 460 +++--- ...tualNetworkPeeringsOperationsExtensions.cs | 93 +- .../Generated/VirtualNetworksOperations.cs | 671 ++++---- .../VirtualNetworksOperationsExtensions.cs | 117 +- .../Properties/AssemblyInfo.cs | 4 +- .../generate.cmd | 2 +- .../project.json | 2 +- .../VirtualNetworkPeeringTest.json | 1437 +++++++++++++++++ .../Tests/ApplicationGatewayTests.cs | 8 +- .../Tests/VirtualNetworkTests.cs | 155 ++ src/ResourceManagement/Network/Network.sln | 20 +- 192 files changed, 13561 insertions(+), 9479 deletions(-) create mode 100644 src/ResourceManagement/Network/Network.Tests/SessionRecords/Networks.Tests.VirtualNetworkTests/VirtualNetworkPeeringTest.json diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperations.cs index 05e27c3b589e2..3e29976bb1bf8 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperations.cs @@ -2,32 +2,21 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; using System.Linq; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using Microsoft.Rest.Azure; using Models; /// /// ApplicationGatewaysOperations operations. /// - internal partial class ApplicationGatewaysOperations : IServiceOperations, IApplicationGatewaysOperations + internal partial class ApplicationGatewaysOperations : Microsoft.Rest.IServiceOperations, IApplicationGatewaysOperations { /// /// Initializes a new instance of the ApplicationGatewaysOperations class. @@ -35,11 +24,14 @@ internal partial class ApplicationGatewaysOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal ApplicationGatewaysOperations(NetworkManagementClient client) { if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } this.Client = client; } @@ -50,8 +42,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The delete ApplicationGateway operation deletes the specified application - /// gateway. + /// Deletes the specified application gateway. /// /// /// The name of the resource group. @@ -65,17 +56,16 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, applicationGatewayName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete ApplicationGateway operation deletes the specified application - /// gateway. + /// Deletes the specified application gateway. /// /// /// The name of the resource group. @@ -89,63 +79,69 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (applicationGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{applicationGatewayName}", Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -178,30 +174,35 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 202 && (int)_statusCode != 204 && (int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -211,7 +212,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -220,14 +221,13 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Get ApplicationGateway operation retrieves information about the - /// specified application gateway. + /// Gets the specified application gateway. /// /// /// The name of the resource group. @@ -241,63 +241,72 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (applicationGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{applicationGatewayName}", Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -330,43 +339,43 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -376,7 +385,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -389,36 +398,36 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Put ApplicationGateway operation creates/updates a ApplicationGateway + /// Creates or updates the specified application gateway. /// /// /// The name of the resource group. /// /// - /// The name of the ApplicationGateway. + /// The name of the application gateway. /// /// - /// Parameters supplied to the create/delete ApplicationGateway operation + /// Parameters supplied to the create or update application gateway operation. /// /// /// The headers that will be added to request. @@ -426,10 +435,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, applicationGatewayName, parameters, customHeaders, cancellationToken); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, @@ -437,16 +446,16 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) } /// - /// The Put ApplicationGateway operation creates/updates a ApplicationGateway + /// Creates or updates the specified application gateway. /// /// /// The name of the resource group. /// /// - /// The name of the ApplicationGateway. + /// The name of the application gateway. /// /// - /// Parameters supplied to the create/delete ApplicationGateway operation + /// Parameters supplied to the create or update application gateway operation. /// /// /// Headers that will be added to request. @@ -454,22 +463,31 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (applicationGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); } if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } if (parameters != null) { @@ -477,49 +495,49 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{applicationGatewayName}", Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -545,9 +563,9 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) string _requestContent = null; if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) @@ -558,43 +576,43 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 201 && (int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -604,7 +622,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -617,16 +635,16 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -635,28 +653,27 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a resource group. + /// Lists all application gateways in a resource group. /// /// /// The name of the resource group. @@ -667,57 +684,66 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -750,43 +776,43 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -796,7 +822,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -809,28 +835,27 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a subscription. + /// Gets all the application gateways in a subscription. /// /// /// Headers that will be added to request. @@ -838,51 +863,60 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -915,43 +949,43 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -961,7 +995,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -974,28 +1008,27 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Start ApplicationGateway operation starts application gateway in the - /// specified resource group through Network resource provider. + /// Starts the specified application gateway. /// /// /// The name of the resource group. @@ -1009,17 +1042,16 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task StartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task StartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync( resourceGroupName, applicationGatewayName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The Start ApplicationGateway operation starts application gateway in the - /// specified resource group through Network resource provider. + /// Starts the specified application gateway. /// /// /// The name of the resource group. @@ -1033,63 +1065,69 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (applicationGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{applicationGatewayName}", Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1122,30 +1160,35 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1155,7 +1198,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1164,14 +1207,13 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The STOP ApplicationGateway operation stops application gateway in the - /// specified resource group through Network resource provider. + /// Stops the specified application gateway in a resource group. /// /// /// The name of the resource group. @@ -1185,17 +1227,16 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task StopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task StopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync( resourceGroupName, applicationGatewayName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The STOP ApplicationGateway operation stops application gateway in the - /// specified resource group through Network resource provider. + /// Stops the specified application gateway in a resource group. /// /// /// The name of the resource group. @@ -1209,63 +1250,69 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (applicationGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStop", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStop", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{applicationGatewayName}", Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1298,30 +1345,35 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1331,7 +1383,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1340,14 +1392,14 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The BackendHealth operation gets the backend health of application gateway - /// in the specified resource group through Network resource provider. + /// Gets the backend health of the specified application gateway in a resource + /// group. /// /// /// The name of the resource group. @@ -1365,17 +1417,17 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> BackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginBackendHealthWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginBackendHealthWithHttpMessagesAsync( resourceGroupName, applicationGatewayName, expand, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The BackendHealth operation gets the backend health of application gateway - /// in the specified resource group through Network resource provider. + /// Gets the backend health of the specified application gateway in a resource + /// group. /// /// /// The name of the resource group. @@ -1393,68 +1445,77 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginBackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginBackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (applicationGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginBackendHealth", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginBackendHealth", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{applicationGatewayName}", Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (expand != null) { - _queryParameters.Add(string.Format("$expand={0}", Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1487,43 +1548,43 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1533,7 +1594,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1546,28 +1607,27 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a resource group. + /// Lists all application gateways in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -1578,43 +1638,52 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1647,43 +1716,43 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1693,7 +1762,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1706,28 +1775,27 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a subscription. + /// Gets all the application gateways in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -1738,43 +1806,52 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1807,43 +1884,43 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1853,7 +1930,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1866,21 +1943,21 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperationsExtensions.cs index 47e4c97e3359e..2c6b2d7fa89cd 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperationsExtensions.cs @@ -2,20 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; + using Microsoft.Rest.Azure; + using Models; /// /// Extension methods for ApplicationGatewaysOperations. @@ -23,8 +18,7 @@ namespace Microsoft.Azure.Management.Network public static partial class ApplicationGatewaysOperationsExtensions { /// - /// The delete ApplicationGateway operation deletes the specified application - /// gateway. + /// Deletes the specified application gateway. /// /// /// The operations group for this extension method. @@ -37,12 +31,11 @@ public static partial class ApplicationGatewaysOperationsExtensions /// public static void Delete(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).DeleteAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).DeleteAsync(resourceGroupName, applicationGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete ApplicationGateway operation deletes the specified application - /// gateway. + /// Deletes the specified application gateway. /// /// /// The operations group for this extension method. @@ -56,14 +49,13 @@ public static void Delete(this IApplicationGatewaysOperations operations, string /// /// The cancellation token. /// - public static async Task DeleteAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// The delete ApplicationGateway operation deletes the specified application - /// gateway. + /// Deletes the specified application gateway. /// /// /// The operations group for this extension method. @@ -76,12 +68,11 @@ public static void Delete(this IApplicationGatewaysOperations operations, string /// public static void BeginDelete(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginDeleteAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginDeleteAsync(resourceGroupName, applicationGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete ApplicationGateway operation deletes the specified application - /// gateway. + /// Deletes the specified application gateway. /// /// /// The operations group for this extension method. @@ -95,14 +86,13 @@ public static void BeginDelete(this IApplicationGatewaysOperations operations, s /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Get ApplicationGateway operation retrieves information about the - /// specified application gateway. + /// Gets the specified application gateway. /// /// /// The operations group for this extension method. @@ -115,12 +105,11 @@ public static void BeginDelete(this IApplicationGatewaysOperations operations, s /// public static ApplicationGateway Get(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).GetAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).GetAsync(resourceGroupName, applicationGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get ApplicationGateway operation retrieves information about the - /// specified application gateway. + /// Gets the specified application gateway. /// /// /// The operations group for this extension method. @@ -134,7 +123,7 @@ public static ApplicationGateway Get(this IApplicationGatewaysOperations operati /// /// The cancellation token. /// - public static async Task GetAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)) { @@ -143,7 +132,7 @@ public static ApplicationGateway Get(this IApplicationGatewaysOperations operati } /// - /// The Put ApplicationGateway operation creates/updates a ApplicationGateway + /// Creates or updates the specified application gateway. /// /// /// The operations group for this extension method. @@ -152,18 +141,18 @@ public static ApplicationGateway Get(this IApplicationGatewaysOperations operati /// The name of the resource group. /// /// - /// The name of the ApplicationGateway. + /// The name of the application gateway. /// /// - /// Parameters supplied to the create/delete ApplicationGateway operation + /// Parameters supplied to the create or update application gateway operation. /// public static ApplicationGateway CreateOrUpdate(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters) { - return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).CreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).CreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put ApplicationGateway operation creates/updates a ApplicationGateway + /// Creates or updates the specified application gateway. /// /// /// The operations group for this extension method. @@ -172,15 +161,15 @@ public static ApplicationGateway CreateOrUpdate(this IApplicationGatewaysOperati /// The name of the resource group. /// /// - /// The name of the ApplicationGateway. + /// The name of the application gateway. /// /// - /// Parameters supplied to the create/delete ApplicationGateway operation + /// Parameters supplied to the create or update application gateway operation. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -189,7 +178,7 @@ public static ApplicationGateway CreateOrUpdate(this IApplicationGatewaysOperati } /// - /// The Put ApplicationGateway operation creates/updates a ApplicationGateway + /// Creates or updates the specified application gateway. /// /// /// The operations group for this extension method. @@ -198,18 +187,18 @@ public static ApplicationGateway CreateOrUpdate(this IApplicationGatewaysOperati /// The name of the resource group. /// /// - /// The name of the ApplicationGateway. + /// The name of the application gateway. /// /// - /// Parameters supplied to the create/delete ApplicationGateway operation + /// Parameters supplied to the create or update application gateway operation. /// public static ApplicationGateway BeginCreateOrUpdate(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters) { - return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put ApplicationGateway operation creates/updates a ApplicationGateway + /// Creates or updates the specified application gateway. /// /// /// The operations group for this extension method. @@ -218,15 +207,15 @@ public static ApplicationGateway BeginCreateOrUpdate(this IApplicationGatewaysOp /// The name of the resource group. /// /// - /// The name of the ApplicationGateway. + /// The name of the application gateway. /// /// - /// Parameters supplied to the create/delete ApplicationGateway operation + /// Parameters supplied to the create or update application gateway operation. /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -235,8 +224,7 @@ public static ApplicationGateway BeginCreateOrUpdate(this IApplicationGatewaysOp } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a resource group. + /// Lists all application gateways in a resource group. /// /// /// The operations group for this extension method. @@ -244,14 +232,13 @@ public static ApplicationGateway BeginCreateOrUpdate(this IApplicationGatewaysOp /// /// The name of the resource group. /// - public static IPage List(this IApplicationGatewaysOperations operations, string resourceGroupName) + public static Microsoft.Rest.Azure.IPage List(this IApplicationGatewaysOperations operations, string resourceGroupName) { - return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a resource group. + /// Lists all application gateways in a resource group. /// /// /// The operations group for this extension method. @@ -262,7 +249,7 @@ public static IPage List(this IApplicationGatewaysOperations /// /// The cancellation token. /// - public static async Task> ListAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { @@ -271,20 +258,18 @@ public static IPage List(this IApplicationGatewaysOperations } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a subscription. + /// Gets all the application gateways in a subscription. /// /// /// The operations group for this extension method. /// - public static IPage ListAll(this IApplicationGatewaysOperations operations) + public static Microsoft.Rest.Azure.IPage ListAll(this IApplicationGatewaysOperations operations) { - return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).ListAllAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a subscription. + /// Gets all the application gateways in a subscription. /// /// /// The operations group for this extension method. @@ -292,7 +277,7 @@ public static IPage ListAll(this IApplicationGatewaysOperati /// /// The cancellation token. /// - public static async Task> ListAllAsync(this IApplicationGatewaysOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllAsync(this IApplicationGatewaysOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -301,8 +286,7 @@ public static IPage ListAll(this IApplicationGatewaysOperati } /// - /// The Start ApplicationGateway operation starts application gateway in the - /// specified resource group through Network resource provider. + /// Starts the specified application gateway. /// /// /// The operations group for this extension method. @@ -315,12 +299,11 @@ public static IPage ListAll(this IApplicationGatewaysOperati /// public static void Start(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).StartAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).StartAsync(resourceGroupName, applicationGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Start ApplicationGateway operation starts application gateway in the - /// specified resource group through Network resource provider. + /// Starts the specified application gateway. /// /// /// The operations group for this extension method. @@ -334,14 +317,13 @@ public static void Start(this IApplicationGatewaysOperations operations, string /// /// The cancellation token. /// - public static async Task StartAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task StartAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.StartWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Start ApplicationGateway operation starts application gateway in the - /// specified resource group through Network resource provider. + /// Starts the specified application gateway. /// /// /// The operations group for this extension method. @@ -354,12 +336,11 @@ public static void Start(this IApplicationGatewaysOperations operations, string /// public static void BeginStart(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginStartAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginStartAsync(resourceGroupName, applicationGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Start ApplicationGateway operation starts application gateway in the - /// specified resource group through Network resource provider. + /// Starts the specified application gateway. /// /// /// The operations group for this extension method. @@ -373,14 +354,13 @@ public static void BeginStart(this IApplicationGatewaysOperations operations, st /// /// The cancellation token. /// - public static async Task BeginStartAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginStartAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// The STOP ApplicationGateway operation stops application gateway in the - /// specified resource group through Network resource provider. + /// Stops the specified application gateway in a resource group. /// /// /// The operations group for this extension method. @@ -393,12 +373,11 @@ public static void BeginStart(this IApplicationGatewaysOperations operations, st /// public static void Stop(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).StopAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).StopAsync(resourceGroupName, applicationGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The STOP ApplicationGateway operation stops application gateway in the - /// specified resource group through Network resource provider. + /// Stops the specified application gateway in a resource group. /// /// /// The operations group for this extension method. @@ -412,14 +391,13 @@ public static void Stop(this IApplicationGatewaysOperations operations, string r /// /// The cancellation token. /// - public static async Task StopAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task StopAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.StopWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// The STOP ApplicationGateway operation stops application gateway in the - /// specified resource group through Network resource provider. + /// Stops the specified application gateway in a resource group. /// /// /// The operations group for this extension method. @@ -432,12 +410,11 @@ public static void Stop(this IApplicationGatewaysOperations operations, string r /// public static void BeginStop(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginStopAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginStopAsync(resourceGroupName, applicationGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The STOP ApplicationGateway operation stops application gateway in the - /// specified resource group through Network resource provider. + /// Stops the specified application gateway in a resource group. /// /// /// The operations group for this extension method. @@ -451,14 +428,14 @@ public static void BeginStop(this IApplicationGatewaysOperations operations, str /// /// The cancellation token. /// - public static async Task BeginStopAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginStopAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.BeginStopWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// The BackendHealth operation gets the backend health of application gateway - /// in the specified resource group through Network resource provider. + /// Gets the backend health of the specified application gateway in a resource + /// group. /// /// /// The operations group for this extension method. @@ -475,12 +452,12 @@ public static void BeginStop(this IApplicationGatewaysOperations operations, str /// public static ApplicationGatewayBackendHealth BackendHealth(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string)) { - return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BackendHealthAsync(resourceGroupName, applicationGatewayName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BackendHealthAsync(resourceGroupName, applicationGatewayName, expand), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The BackendHealth operation gets the backend health of application gateway - /// in the specified resource group through Network resource provider. + /// Gets the backend health of the specified application gateway in a resource + /// group. /// /// /// The operations group for this extension method. @@ -498,7 +475,7 @@ public static void BeginStop(this IApplicationGatewaysOperations operations, str /// /// The cancellation token. /// - public static async Task BackendHealthAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BackendHealthAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BackendHealthWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, expand, null, cancellationToken).ConfigureAwait(false)) { @@ -507,8 +484,8 @@ public static void BeginStop(this IApplicationGatewaysOperations operations, str } /// - /// The BackendHealth operation gets the backend health of application gateway - /// in the specified resource group through Network resource provider. + /// Gets the backend health of the specified application gateway in a resource + /// group. /// /// /// The operations group for this extension method. @@ -525,12 +502,12 @@ public static void BeginStop(this IApplicationGatewaysOperations operations, str /// public static ApplicationGatewayBackendHealth BeginBackendHealth(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string)) { - return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The BackendHealth operation gets the backend health of application gateway - /// in the specified resource group through Network resource provider. + /// Gets the backend health of the specified application gateway in a resource + /// group. /// /// /// The operations group for this extension method. @@ -548,7 +525,7 @@ public static void BeginStop(this IApplicationGatewaysOperations operations, str /// /// The cancellation token. /// - public static async Task BeginBackendHealthAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginBackendHealthAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginBackendHealthWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, expand, null, cancellationToken).ConfigureAwait(false)) { @@ -557,8 +534,7 @@ public static void BeginStop(this IApplicationGatewaysOperations operations, str } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a resource group. + /// Lists all application gateways in a resource group. /// /// /// The operations group for this extension method. @@ -566,14 +542,13 @@ public static void BeginStop(this IApplicationGatewaysOperations operations, str /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this IApplicationGatewaysOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListNext(this IApplicationGatewaysOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a resource group. + /// Lists all application gateways in a resource group. /// /// /// The operations group for this extension method. @@ -584,7 +559,7 @@ public static IPage ListNext(this IApplicationGatewaysOperat /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IApplicationGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this IApplicationGatewaysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -593,8 +568,7 @@ public static IPage ListNext(this IApplicationGatewaysOperat } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a subscription. + /// Gets all the application gateways in a subscription. /// /// /// The operations group for this extension method. @@ -602,14 +576,13 @@ public static IPage ListNext(this IApplicationGatewaysOperat /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListAllNext(this IApplicationGatewaysOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListAllNext(this IApplicationGatewaysOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).ListAllNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).ListAllNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a subscription. + /// Gets all the application gateways in a subscription. /// /// /// The operations group for this extension method. @@ -620,7 +593,7 @@ public static IPage ListAllNext(this IApplicationGatewaysOpe /// /// The cancellation token. /// - public static async Task> ListAllNextAsync(this IApplicationGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllNextAsync(this IApplicationGatewaysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs index 8f8d22caaaa15..d4dc99c45dd22 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs @@ -2,32 +2,21 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; using System.Linq; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using Microsoft.Rest.Azure; using Models; /// /// ExpressRouteCircuitAuthorizationsOperations operations. /// - internal partial class ExpressRouteCircuitAuthorizationsOperations : IServiceOperations, IExpressRouteCircuitAuthorizationsOperations + internal partial class ExpressRouteCircuitAuthorizationsOperations : Microsoft.Rest.IServiceOperations, IExpressRouteCircuitAuthorizationsOperations { /// /// Initializes a new instance of the ExpressRouteCircuitAuthorizationsOperations class. @@ -35,11 +24,14 @@ internal partial class ExpressRouteCircuitAuthorizationsOperations : IServiceOpe /// /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient client) { if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } this.Client = client; } @@ -50,8 +42,8 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli public NetworkManagementClient Client { get; private set; } /// - /// The delete authorization operation deletes the specified authorization - /// from the specified ExpressRouteCircuit. + /// Deletes the specified authorization from the specified express route + /// circuit. /// /// /// The name of the resource group. @@ -68,17 +60,17 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, circuitName, authorizationName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete authorization operation deletes the specified authorization - /// from the specified ExpressRouteCircuit. + /// Deletes the specified authorization from the specified express route + /// circuit. /// /// /// The name of the resource group. @@ -95,69 +87,75 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } if (authorizationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "authorizationName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("authorizationName", authorizationName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{authorizationName}", Uri.EscapeDataString(authorizationName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -190,30 +188,35 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 202 && (int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -223,7 +226,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -232,14 +235,13 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The GET authorization operation retrieves the specified authorization from - /// the specified ExpressRouteCircuit. + /// Gets the specified authorization from the specified express route circuit. /// /// /// The name of the resource group. @@ -256,69 +258,78 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } if (authorizationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "authorizationName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("authorizationName", authorizationName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{authorizationName}", Uri.EscapeDataString(authorizationName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -351,43 +362,43 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -397,7 +408,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -410,28 +421,27 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Put Authorization operation creates/updates an authorization in the - /// specified ExpressRouteCircuits + /// Creates or updates an authorization in the specified express route circuit. /// /// /// The name of the resource group. @@ -443,8 +453,8 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// The name of the authorization. /// /// - /// Parameters supplied to the create/update ExpressRouteCircuitAuthorization - /// operation + /// Parameters supplied to the create or update express route circuit + /// authorization operation. /// /// /// The headers that will be added to request. @@ -452,10 +462,10 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, circuitName, authorizationName, authorizationParameters, customHeaders, cancellationToken); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, @@ -463,8 +473,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli } /// - /// The Put Authorization operation creates/updates an authorization in the - /// specified ExpressRouteCircuits + /// Creates or updates an authorization in the specified express route circuit. /// /// /// The name of the resource group. @@ -476,8 +485,8 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// The name of the authorization. /// /// - /// Parameters supplied to the create/update ExpressRouteCircuitAuthorization - /// operation + /// Parameters supplied to the create or update express route circuit + /// authorization operation. /// /// /// Headers that will be added to request. @@ -485,74 +494,83 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } if (authorizationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "authorizationName"); } if (authorizationParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "authorizationParameters"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("authorizationName", authorizationName); tracingParameters.Add("authorizationParameters", authorizationParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{authorizationName}", Uri.EscapeDataString(authorizationName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -578,9 +596,9 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli string _requestContent = null; if(authorizationParameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(authorizationParameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(authorizationParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) @@ -591,43 +609,43 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 201 && (int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -637,7 +655,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -650,16 +668,16 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -668,28 +686,27 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List authorization operation retrieves all the authorizations in an - /// ExpressRouteCircuit. + /// Gets all authorizations in an express route circuit. /// /// /// The name of the resource group. @@ -703,63 +720,72 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -792,43 +818,43 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -838,7 +864,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -851,28 +877,27 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List authorization operation retrieves all the authorizations in an - /// ExpressRouteCircuit. + /// Gets all authorizations in an express route circuit. /// /// /// The NextLink from the previous successful call to List operation. @@ -883,43 +908,52 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -952,43 +986,43 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -998,7 +1032,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1011,21 +1045,21 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperationsExtensions.cs index 2c3a3b979e835..25ed26019615d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperationsExtensions.cs @@ -2,20 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; + using Microsoft.Rest.Azure; + using Models; /// /// Extension methods for ExpressRouteCircuitAuthorizationsOperations. @@ -23,8 +18,8 @@ namespace Microsoft.Azure.Management.Network public static partial class ExpressRouteCircuitAuthorizationsOperationsExtensions { /// - /// The delete authorization operation deletes the specified authorization - /// from the specified ExpressRouteCircuit. + /// Deletes the specified authorization from the specified express route + /// circuit. /// /// /// The operations group for this extension method. @@ -40,12 +35,12 @@ public static partial class ExpressRouteCircuitAuthorizationsOperationsExtension /// public static void Delete(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName) { - Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).DeleteAsync(resourceGroupName, circuitName, authorizationName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).DeleteAsync(resourceGroupName, circuitName, authorizationName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete authorization operation deletes the specified authorization - /// from the specified ExpressRouteCircuit. + /// Deletes the specified authorization from the specified express route + /// circuit. /// /// /// The operations group for this extension method. @@ -62,14 +57,14 @@ public static void Delete(this IExpressRouteCircuitAuthorizationsOperations oper /// /// The cancellation token. /// - public static async Task DeleteAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false); } /// - /// The delete authorization operation deletes the specified authorization - /// from the specified ExpressRouteCircuit. + /// Deletes the specified authorization from the specified express route + /// circuit. /// /// /// The operations group for this extension method. @@ -85,12 +80,12 @@ public static void Delete(this IExpressRouteCircuitAuthorizationsOperations oper /// public static void BeginDelete(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName) { - Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).BeginDeleteAsync(resourceGroupName, circuitName, authorizationName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).BeginDeleteAsync(resourceGroupName, circuitName, authorizationName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete authorization operation deletes the specified authorization - /// from the specified ExpressRouteCircuit. + /// Deletes the specified authorization from the specified express route + /// circuit. /// /// /// The operations group for this extension method. @@ -107,14 +102,13 @@ public static void BeginDelete(this IExpressRouteCircuitAuthorizationsOperations /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false); } /// - /// The GET authorization operation retrieves the specified authorization from - /// the specified ExpressRouteCircuit. + /// Gets the specified authorization from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -130,12 +124,11 @@ public static void BeginDelete(this IExpressRouteCircuitAuthorizationsOperations /// public static ExpressRouteCircuitAuthorization Get(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).GetAsync(resourceGroupName, circuitName, authorizationName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).GetAsync(resourceGroupName, circuitName, authorizationName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The GET authorization operation retrieves the specified authorization from - /// the specified ExpressRouteCircuit. + /// Gets the specified authorization from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -152,7 +145,7 @@ public static ExpressRouteCircuitAuthorization Get(this IExpressRouteCircuitAuth /// /// The cancellation token. /// - public static async Task GetAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false)) { @@ -161,8 +154,7 @@ public static ExpressRouteCircuitAuthorization Get(this IExpressRouteCircuitAuth } /// - /// The Put Authorization operation creates/updates an authorization in the - /// specified ExpressRouteCircuits + /// Creates or updates an authorization in the specified express route circuit. /// /// /// The operations group for this extension method. @@ -177,17 +169,16 @@ public static ExpressRouteCircuitAuthorization Get(this IExpressRouteCircuitAuth /// The name of the authorization. /// /// - /// Parameters supplied to the create/update ExpressRouteCircuitAuthorization - /// operation + /// Parameters supplied to the create or update express route circuit + /// authorization operation. /// public static ExpressRouteCircuitAuthorization CreateOrUpdate(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).CreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).CreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put Authorization operation creates/updates an authorization in the - /// specified ExpressRouteCircuits + /// Creates or updates an authorization in the specified express route circuit. /// /// /// The operations group for this extension method. @@ -202,13 +193,13 @@ public static ExpressRouteCircuitAuthorization CreateOrUpdate(this IExpressRoute /// The name of the authorization. /// /// - /// Parameters supplied to the create/update ExpressRouteCircuitAuthorization - /// operation + /// Parameters supplied to the create or update express route circuit + /// authorization operation. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters, null, cancellationToken).ConfigureAwait(false)) { @@ -217,8 +208,7 @@ public static ExpressRouteCircuitAuthorization CreateOrUpdate(this IExpressRoute } /// - /// The Put Authorization operation creates/updates an authorization in the - /// specified ExpressRouteCircuits + /// Creates or updates an authorization in the specified express route circuit. /// /// /// The operations group for this extension method. @@ -233,17 +223,16 @@ public static ExpressRouteCircuitAuthorization CreateOrUpdate(this IExpressRoute /// The name of the authorization. /// /// - /// Parameters supplied to the create/update ExpressRouteCircuitAuthorization - /// operation + /// Parameters supplied to the create or update express route circuit + /// authorization operation. /// public static ExpressRouteCircuitAuthorization BeginCreateOrUpdate(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put Authorization operation creates/updates an authorization in the - /// specified ExpressRouteCircuits + /// Creates or updates an authorization in the specified express route circuit. /// /// /// The operations group for this extension method. @@ -258,13 +247,13 @@ public static ExpressRouteCircuitAuthorization BeginCreateOrUpdate(this IExpress /// The name of the authorization. /// /// - /// Parameters supplied to the create/update ExpressRouteCircuitAuthorization - /// operation + /// Parameters supplied to the create or update express route circuit + /// authorization operation. /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters, null, cancellationToken).ConfigureAwait(false)) { @@ -273,8 +262,7 @@ public static ExpressRouteCircuitAuthorization BeginCreateOrUpdate(this IExpress } /// - /// The List authorization operation retrieves all the authorizations in an - /// ExpressRouteCircuit. + /// Gets all authorizations in an express route circuit. /// /// /// The operations group for this extension method. @@ -285,14 +273,13 @@ public static ExpressRouteCircuitAuthorization BeginCreateOrUpdate(this IExpress /// /// The name of the circuit. /// - public static IPage List(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName) + public static Microsoft.Rest.Azure.IPage List(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).ListAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).ListAsync(resourceGroupName, circuitName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List authorization operation retrieves all the authorizations in an - /// ExpressRouteCircuit. + /// Gets all authorizations in an express route circuit. /// /// /// The operations group for this extension method. @@ -306,7 +293,7 @@ public static IPage List(this IExpressRouteCir /// /// The cancellation token. /// - public static async Task> ListAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) { @@ -315,8 +302,7 @@ public static IPage List(this IExpressRouteCir } /// - /// The List authorization operation retrieves all the authorizations in an - /// ExpressRouteCircuit. + /// Gets all authorizations in an express route circuit. /// /// /// The operations group for this extension method. @@ -324,14 +310,13 @@ public static IPage List(this IExpressRouteCir /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this IExpressRouteCircuitAuthorizationsOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListNext(this IExpressRouteCircuitAuthorizationsOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List authorization operation retrieves all the authorizations in an - /// ExpressRouteCircuit. + /// Gets all authorizations in an express route circuit. /// /// /// The operations group for this extension method. @@ -342,7 +327,7 @@ public static IPage ListNext(this IExpressRout /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs index 4cbda14678001..e258e03e0fb9c 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs @@ -2,32 +2,21 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; using System.Linq; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using Microsoft.Rest.Azure; using Models; /// /// ExpressRouteCircuitPeeringsOperations operations. /// - internal partial class ExpressRouteCircuitPeeringsOperations : IServiceOperations, IExpressRouteCircuitPeeringsOperations + internal partial class ExpressRouteCircuitPeeringsOperations : Microsoft.Rest.IServiceOperations, IExpressRouteCircuitPeeringsOperations { /// /// Initializes a new instance of the ExpressRouteCircuitPeeringsOperations class. @@ -35,11 +24,14 @@ internal partial class ExpressRouteCircuitPeeringsOperations : IServiceOperation /// /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } this.Client = client; } @@ -50,8 +42,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The delete peering operation deletes the specified peering from the - /// ExpressRouteCircuit. + /// Deletes the specified peering from the specified express route circuit. /// /// /// The name of the resource group. @@ -68,17 +59,16 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, circuitName, peeringName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete peering operation deletes the specified peering from the - /// ExpressRouteCircuit. + /// Deletes the specified peering from the specified express route circuit. /// /// /// The name of the resource group. @@ -95,69 +85,75 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{peeringName}", Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -190,30 +186,35 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -223,7 +224,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -232,14 +233,13 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The GET peering operation retrieves the specified authorization from the - /// ExpressRouteCircuit. + /// Gets the specified authorization from the specified express route circuit. /// /// /// The name of the resource group. @@ -256,69 +256,78 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{peeringName}", Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -351,43 +360,43 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -397,7 +406,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -410,28 +419,27 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Put Peering operation creates/updates an peering in the specified - /// ExpressRouteCircuits + /// Creates or updates a peering in the specified express route circuits. /// /// /// The name of the resource group. @@ -443,8 +451,8 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// The name of the peering. /// /// - /// Parameters supplied to the create/update ExpressRouteCircuit Peering - /// operation + /// Parameters supplied to the create or update express route circuit peering + /// operation. /// /// /// The headers that will be added to request. @@ -452,10 +460,10 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, circuitName, peeringName, peeringParameters, customHeaders, cancellationToken); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, @@ -463,8 +471,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) } /// - /// The Put Peering operation creates/updates an peering in the specified - /// ExpressRouteCircuits + /// Creates or updates a peering in the specified express route circuits. /// /// /// The name of the resource group. @@ -476,8 +483,8 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// The name of the peering. /// /// - /// Parameters supplied to the create/update ExpressRouteCircuit Peering - /// operation + /// Parameters supplied to the create or update express route circuit peering + /// operation. /// /// /// Headers that will be added to request. @@ -485,74 +492,83 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } if (peeringParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringParameters"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("peeringParameters", peeringParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{peeringName}", Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -578,9 +594,9 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) string _requestContent = null; if(peeringParameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(peeringParameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(peeringParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) @@ -591,43 +607,43 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -637,7 +653,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -650,16 +666,16 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -668,34 +684,33 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List peering operation retrieves all the peerings in an - /// ExpressRouteCircuit. + /// Gets all peerings in a specified express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// Headers that will be added to request. @@ -703,63 +718,72 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -792,43 +816,43 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -838,7 +862,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -851,28 +875,27 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List peering operation retrieves all the peerings in an - /// ExpressRouteCircuit. + /// Gets all peerings in a specified express route circuit. /// /// /// The NextLink from the previous successful call to List operation. @@ -883,43 +906,52 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -952,43 +984,43 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -998,7 +1030,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1011,21 +1043,21 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperationsExtensions.cs index cd56ff2f3840c..5ac76651bc03f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperationsExtensions.cs @@ -2,20 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; + using Microsoft.Rest.Azure; + using Models; /// /// Extension methods for ExpressRouteCircuitPeeringsOperations. @@ -23,8 +18,7 @@ namespace Microsoft.Azure.Management.Network public static partial class ExpressRouteCircuitPeeringsOperationsExtensions { /// - /// The delete peering operation deletes the specified peering from the - /// ExpressRouteCircuit. + /// Deletes the specified peering from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -40,12 +34,11 @@ public static partial class ExpressRouteCircuitPeeringsOperationsExtensions /// public static void Delete(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName) { - Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).DeleteAsync(resourceGroupName, circuitName, peeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).DeleteAsync(resourceGroupName, circuitName, peeringName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete peering operation deletes the specified peering from the - /// ExpressRouteCircuit. + /// Deletes the specified peering from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -62,14 +55,13 @@ public static void Delete(this IExpressRouteCircuitPeeringsOperations operations /// /// The cancellation token. /// - public static async Task DeleteAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false); } /// - /// The delete peering operation deletes the specified peering from the - /// ExpressRouteCircuit. + /// Deletes the specified peering from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -85,12 +77,11 @@ public static void Delete(this IExpressRouteCircuitPeeringsOperations operations /// public static void BeginDelete(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName) { - Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).BeginDeleteAsync(resourceGroupName, circuitName, peeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).BeginDeleteAsync(resourceGroupName, circuitName, peeringName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete peering operation deletes the specified peering from the - /// ExpressRouteCircuit. + /// Deletes the specified peering from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -107,14 +98,13 @@ public static void BeginDelete(this IExpressRouteCircuitPeeringsOperations opera /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false); } /// - /// The GET peering operation retrieves the specified authorization from the - /// ExpressRouteCircuit. + /// Gets the specified authorization from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -130,12 +120,11 @@ public static void BeginDelete(this IExpressRouteCircuitPeeringsOperations opera /// public static ExpressRouteCircuitPeering Get(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).GetAsync(resourceGroupName, circuitName, peeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).GetAsync(resourceGroupName, circuitName, peeringName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The GET peering operation retrieves the specified authorization from the - /// ExpressRouteCircuit. + /// Gets the specified authorization from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -152,7 +141,7 @@ public static ExpressRouteCircuitPeering Get(this IExpressRouteCircuitPeeringsOp /// /// The cancellation token. /// - public static async Task GetAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)) { @@ -161,8 +150,7 @@ public static ExpressRouteCircuitPeering Get(this IExpressRouteCircuitPeeringsOp } /// - /// The Put Peering operation creates/updates an peering in the specified - /// ExpressRouteCircuits + /// Creates or updates a peering in the specified express route circuits. /// /// /// The operations group for this extension method. @@ -177,17 +165,16 @@ public static ExpressRouteCircuitPeering Get(this IExpressRouteCircuitPeeringsOp /// The name of the peering. /// /// - /// Parameters supplied to the create/update ExpressRouteCircuit Peering - /// operation + /// Parameters supplied to the create or update express route circuit peering + /// operation. /// public static ExpressRouteCircuitPeering CreateOrUpdate(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).CreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).CreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put Peering operation creates/updates an peering in the specified - /// ExpressRouteCircuits + /// Creates or updates a peering in the specified express route circuits. /// /// /// The operations group for this extension method. @@ -202,13 +189,13 @@ public static ExpressRouteCircuitPeering CreateOrUpdate(this IExpressRouteCircui /// The name of the peering. /// /// - /// Parameters supplied to the create/update ExpressRouteCircuit Peering - /// operation + /// Parameters supplied to the create or update express route circuit peering + /// operation. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) { @@ -217,8 +204,7 @@ public static ExpressRouteCircuitPeering CreateOrUpdate(this IExpressRouteCircui } /// - /// The Put Peering operation creates/updates an peering in the specified - /// ExpressRouteCircuits + /// Creates or updates a peering in the specified express route circuits. /// /// /// The operations group for this extension method. @@ -233,17 +219,16 @@ public static ExpressRouteCircuitPeering CreateOrUpdate(this IExpressRouteCircui /// The name of the peering. /// /// - /// Parameters supplied to the create/update ExpressRouteCircuit Peering - /// operation + /// Parameters supplied to the create or update express route circuit peering + /// operation. /// public static ExpressRouteCircuitPeering BeginCreateOrUpdate(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put Peering operation creates/updates an peering in the specified - /// ExpressRouteCircuits + /// Creates or updates a peering in the specified express route circuits. /// /// /// The operations group for this extension method. @@ -258,13 +243,13 @@ public static ExpressRouteCircuitPeering BeginCreateOrUpdate(this IExpressRouteC /// The name of the peering. /// /// - /// Parameters supplied to the create/update ExpressRouteCircuit Peering - /// operation + /// Parameters supplied to the create or update express route circuit peering + /// operation. /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) { @@ -273,8 +258,7 @@ public static ExpressRouteCircuitPeering BeginCreateOrUpdate(this IExpressRouteC } /// - /// The List peering operation retrieves all the peerings in an - /// ExpressRouteCircuit. + /// Gets all peerings in a specified express route circuit. /// /// /// The operations group for this extension method. @@ -283,16 +267,15 @@ public static ExpressRouteCircuitPeering BeginCreateOrUpdate(this IExpressRouteC /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// - public static IPage List(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName) + public static Microsoft.Rest.Azure.IPage List(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).ListAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).ListAsync(resourceGroupName, circuitName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List peering operation retrieves all the peerings in an - /// ExpressRouteCircuit. + /// Gets all peerings in a specified express route circuit. /// /// /// The operations group for this extension method. @@ -301,12 +284,12 @@ public static IPage List(this IExpressRouteCircuitPe /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) { @@ -315,8 +298,7 @@ public static IPage List(this IExpressRouteCircuitPe } /// - /// The List peering operation retrieves all the peerings in an - /// ExpressRouteCircuit. + /// Gets all peerings in a specified express route circuit. /// /// /// The operations group for this extension method. @@ -324,14 +306,13 @@ public static IPage List(this IExpressRouteCircuitPe /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this IExpressRouteCircuitPeeringsOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListNext(this IExpressRouteCircuitPeeringsOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List peering operation retrieves all the peerings in an - /// ExpressRouteCircuit. + /// Gets all peerings in a specified express route circuit. /// /// /// The operations group for this extension method. @@ -342,7 +323,7 @@ public static IPage ListNext(this IExpressRouteCircu /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IExpressRouteCircuitPeeringsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this IExpressRouteCircuitPeeringsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperations.cs index be7704660d72f..a068441d73772 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperations.cs @@ -2,32 +2,21 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; using System.Linq; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using Microsoft.Rest.Azure; using Models; /// /// ExpressRouteCircuitsOperations operations. /// - internal partial class ExpressRouteCircuitsOperations : IServiceOperations, IExpressRouteCircuitsOperations + internal partial class ExpressRouteCircuitsOperations : Microsoft.Rest.IServiceOperations, IExpressRouteCircuitsOperations { /// /// Initializes a new instance of the ExpressRouteCircuitsOperations class. @@ -35,11 +24,14 @@ internal partial class ExpressRouteCircuitsOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } this.Client = client; } @@ -50,14 +42,13 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The delete ExpressRouteCircuit operation deletes the specified - /// ExpressRouteCircuit. + /// Deletes the specified express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the express route Circuit. + /// The name of the express route circuit. /// /// /// The headers that will be added to request. @@ -65,23 +56,22 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, circuitName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete ExpressRouteCircuit operation deletes the specified - /// ExpressRouteCircuit. + /// Deletes the specified express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the express route Circuit. + /// The name of the express route circuit. /// /// /// Headers that will be added to request. @@ -89,63 +79,69 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -178,30 +174,35 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -211,7 +212,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -220,20 +221,19 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Get ExpressRouteCircuit operation retrieves information about the - /// specified ExpressRouteCircuit. + /// Gets information about the specified express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of express route circuit. /// /// /// Headers that will be added to request. @@ -241,63 +241,72 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -330,43 +339,43 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -376,7 +385,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -389,27 +398,27 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Put ExpressRouteCircuit operation creates/updates a ExpressRouteCircuit + /// Creates or updates an express route circuit. /// /// /// The name of the resource group. @@ -418,7 +427,8 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// The name of the circuit. /// /// - /// Parameters supplied to the create/delete ExpressRouteCircuit operation + /// Parameters supplied to the create or update express route circuit + /// operation. /// /// /// The headers that will be added to request. @@ -426,10 +436,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, circuitName, parameters, customHeaders, cancellationToken); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, @@ -437,7 +447,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) } /// - /// The Put ExpressRouteCircuit operation creates/updates a ExpressRouteCircuit + /// Creates or updates an express route circuit. /// /// /// The name of the resource group. @@ -446,7 +456,8 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// The name of the circuit. /// /// - /// Parameters supplied to the create/delete ExpressRouteCircuit operation + /// Parameters supplied to the create or update express route circuit + /// operation. /// /// /// Headers that will be added to request. @@ -454,68 +465,77 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -541,9 +561,9 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) string _requestContent = null; if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) @@ -554,43 +574,43 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 201 && (int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -600,7 +620,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -613,16 +633,16 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -631,35 +651,34 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The ListArpTable from ExpressRouteCircuit operation retrieves the - /// currently advertised arp table associated with the ExpressRouteCircuits - /// in a resource group. + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -673,24 +692,23 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginListArpTableWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginListArpTableWithHttpMessagesAsync( resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The ListArpTable from ExpressRouteCircuit operation retrieves the - /// currently advertised arp table associated with the ExpressRouteCircuits - /// in a resource group. + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -704,75 +722,84 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } if (devicePath == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "devicePath"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListArpTable", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListArpTable", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{peeringName}", Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{devicePath}", Uri.EscapeDataString(devicePath)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -805,43 +832,43 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -851,7 +878,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -864,35 +891,34 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -906,24 +932,23 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginListRoutesTableWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginListRoutesTableWithHttpMessagesAsync( resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -937,75 +962,84 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } if (devicePath == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "devicePath"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTable", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTable", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{peeringName}", Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{devicePath}", Uri.EscapeDataString(devicePath)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1038,43 +1072,43 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1084,7 +1118,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1097,35 +1131,34 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -1139,24 +1172,23 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginListRoutesTableSummaryWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginListRoutesTableSummaryWithHttpMessagesAsync( resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -1170,75 +1202,84 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } if (devicePath == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "devicePath"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTableSummary", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTableSummary", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{peeringName}", Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{devicePath}", Uri.EscapeDataString(devicePath)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1271,43 +1312,43 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1317,7 +1358,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1330,34 +1371,33 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List stats ExpressRouteCircuit operation retrieves all the stats from - /// a ExpressRouteCircuits in a resource group. + /// Gets all the stats from an express route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// Headers that will be added to request. @@ -1365,63 +1405,72 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStats", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetStats", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1454,43 +1503,43 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1500,7 +1549,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1513,34 +1562,33 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List stats ExpressRouteCircuit operation retrieves all the stats from - /// a ExpressRouteCircuits in a resource group. + /// Gets all stats from an express route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -1551,69 +1599,78 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetPeeringStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetPeeringStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); } if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPeeringStats", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetPeeringStats", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{peeringName}", Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1646,43 +1703,43 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1692,7 +1749,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1705,28 +1762,27 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a resource group. + /// Gets all the express route circuits in a resource group. /// /// /// The name of the resource group. @@ -1737,57 +1793,66 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1820,43 +1885,43 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1866,7 +1931,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1879,28 +1944,27 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a subscription. + /// Gets all the express route circuits in a subscription. /// /// /// Headers that will be added to request. @@ -1908,51 +1972,60 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1985,43 +2058,43 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2031,7 +2104,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2044,28 +2117,27 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a resource group. + /// Gets all the express route circuits in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -2076,43 +2148,52 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -2145,43 +2226,43 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2191,7 +2272,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2204,28 +2285,27 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a subscription. + /// Gets all the express route circuits in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -2236,43 +2316,52 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -2305,43 +2394,43 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2351,7 +2440,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2364,21 +2453,21 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperationsExtensions.cs index 6c577972bd8ba..8cf7875c6aa1e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperationsExtensions.cs @@ -2,20 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; + using Microsoft.Rest.Azure; + using Models; /// /// Extension methods for ExpressRouteCircuitsOperations. @@ -23,8 +18,7 @@ namespace Microsoft.Azure.Management.Network public static partial class ExpressRouteCircuitsOperationsExtensions { /// - /// The delete ExpressRouteCircuit operation deletes the specified - /// ExpressRouteCircuit. + /// Deletes the specified express route circuit. /// /// /// The operations group for this extension method. @@ -33,16 +27,15 @@ public static partial class ExpressRouteCircuitsOperationsExtensions /// The name of the resource group. /// /// - /// The name of the express route Circuit. + /// The name of the express route circuit. /// public static void Delete(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) { - Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).DeleteAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).DeleteAsync(resourceGroupName, circuitName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete ExpressRouteCircuit operation deletes the specified - /// ExpressRouteCircuit. + /// Deletes the specified express route circuit. /// /// /// The operations group for this extension method. @@ -51,19 +44,18 @@ public static void Delete(this IExpressRouteCircuitsOperations operations, strin /// The name of the resource group. /// /// - /// The name of the express route Circuit. + /// The name of the express route circuit. /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false); } /// - /// The delete ExpressRouteCircuit operation deletes the specified - /// ExpressRouteCircuit. + /// Deletes the specified express route circuit. /// /// /// The operations group for this extension method. @@ -72,16 +64,15 @@ public static void Delete(this IExpressRouteCircuitsOperations operations, strin /// The name of the resource group. /// /// - /// The name of the express route Circuit. + /// The name of the express route circuit. /// public static void BeginDelete(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) { - Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginDeleteAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginDeleteAsync(resourceGroupName, circuitName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete ExpressRouteCircuit operation deletes the specified - /// ExpressRouteCircuit. + /// Deletes the specified express route circuit. /// /// /// The operations group for this extension method. @@ -90,19 +81,18 @@ public static void BeginDelete(this IExpressRouteCircuitsOperations operations, /// The name of the resource group. /// /// - /// The name of the express route Circuit. + /// The name of the express route circuit. /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Get ExpressRouteCircuit operation retrieves information about the - /// specified ExpressRouteCircuit. + /// Gets information about the specified express route circuit. /// /// /// The operations group for this extension method. @@ -111,16 +101,15 @@ public static void BeginDelete(this IExpressRouteCircuitsOperations operations, /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of express route circuit. /// public static ExpressRouteCircuit Get(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).GetAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).GetAsync(resourceGroupName, circuitName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get ExpressRouteCircuit operation retrieves information about the - /// specified ExpressRouteCircuit. + /// Gets information about the specified express route circuit. /// /// /// The operations group for this extension method. @@ -129,12 +118,12 @@ public static ExpressRouteCircuit Get(this IExpressRouteCircuitsOperations opera /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of express route circuit. /// /// /// The cancellation token. /// - public static async Task GetAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) { @@ -143,7 +132,7 @@ public static ExpressRouteCircuit Get(this IExpressRouteCircuitsOperations opera } /// - /// The Put ExpressRouteCircuit operation creates/updates a ExpressRouteCircuit + /// Creates or updates an express route circuit. /// /// /// The operations group for this extension method. @@ -155,15 +144,16 @@ public static ExpressRouteCircuit Get(this IExpressRouteCircuitsOperations opera /// The name of the circuit. /// /// - /// Parameters supplied to the create/delete ExpressRouteCircuit operation + /// Parameters supplied to the create or update express route circuit + /// operation. /// public static ExpressRouteCircuit CreateOrUpdate(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).CreateOrUpdateAsync(resourceGroupName, circuitName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).CreateOrUpdateAsync(resourceGroupName, circuitName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put ExpressRouteCircuit operation creates/updates a ExpressRouteCircuit + /// Creates or updates an express route circuit. /// /// /// The operations group for this extension method. @@ -175,12 +165,13 @@ public static ExpressRouteCircuit CreateOrUpdate(this IExpressRouteCircuitsOpera /// The name of the circuit. /// /// - /// Parameters supplied to the create/delete ExpressRouteCircuit operation + /// Parameters supplied to the create or update express route circuit + /// operation. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -189,7 +180,7 @@ public static ExpressRouteCircuit CreateOrUpdate(this IExpressRouteCircuitsOpera } /// - /// The Put ExpressRouteCircuit operation creates/updates a ExpressRouteCircuit + /// Creates or updates an express route circuit. /// /// /// The operations group for this extension method. @@ -201,15 +192,16 @@ public static ExpressRouteCircuit CreateOrUpdate(this IExpressRouteCircuitsOpera /// The name of the circuit. /// /// - /// Parameters supplied to the create/delete ExpressRouteCircuit operation + /// Parameters supplied to the create or update express route circuit + /// operation. /// public static ExpressRouteCircuit BeginCreateOrUpdate(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put ExpressRouteCircuit operation creates/updates a ExpressRouteCircuit + /// Creates or updates an express route circuit. /// /// /// The operations group for this extension method. @@ -221,12 +213,13 @@ public static ExpressRouteCircuit BeginCreateOrUpdate(this IExpressRouteCircuits /// The name of the circuit. /// /// - /// Parameters supplied to the create/delete ExpressRouteCircuit operation + /// Parameters supplied to the create or update express route circuit + /// operation. /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -235,9 +228,8 @@ public static ExpressRouteCircuit BeginCreateOrUpdate(this IExpressRouteCircuits } /// - /// The ListArpTable from ExpressRouteCircuit operation retrieves the - /// currently advertised arp table associated with the ExpressRouteCircuits - /// in a resource group. + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. /// /// /// The operations group for this extension method. @@ -246,7 +238,7 @@ public static ExpressRouteCircuit BeginCreateOrUpdate(this IExpressRouteCircuits /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -256,13 +248,12 @@ public static ExpressRouteCircuit BeginCreateOrUpdate(this IExpressRouteCircuits /// public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The ListArpTable from ExpressRouteCircuit operation retrieves the - /// currently advertised arp table associated with the ExpressRouteCircuits - /// in a resource group. + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. /// /// /// The operations group for this extension method. @@ -271,7 +262,7 @@ public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressR /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -282,7 +273,7 @@ public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressR /// /// The cancellation token. /// - public static async Task ListArpTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task ListArpTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListArpTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { @@ -291,9 +282,8 @@ public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressR } /// - /// The ListArpTable from ExpressRouteCircuit operation retrieves the - /// currently advertised arp table associated with the ExpressRouteCircuits - /// in a resource group. + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. /// /// /// The operations group for this extension method. @@ -302,7 +292,7 @@ public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressR /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -312,13 +302,12 @@ public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressR /// public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The ListArpTable from ExpressRouteCircuit operation retrieves the - /// currently advertised arp table associated with the ExpressRouteCircuits - /// in a resource group. + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. /// /// /// The operations group for this extension method. @@ -327,7 +316,7 @@ public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExp /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -338,7 +327,7 @@ public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExp /// /// The cancellation token. /// - public static async Task BeginListArpTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginListArpTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginListArpTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { @@ -347,9 +336,8 @@ public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExp } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -358,7 +346,7 @@ public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExp /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -368,13 +356,12 @@ public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExp /// public static ExpressRouteCircuitsRoutesTableListResult ListRoutesTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -383,7 +370,7 @@ public static ExpressRouteCircuitsRoutesTableListResult ListRoutesTable(this IEx /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -394,7 +381,7 @@ public static ExpressRouteCircuitsRoutesTableListResult ListRoutesTable(this IEx /// /// The cancellation token. /// - public static async Task ListRoutesTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task ListRoutesTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListRoutesTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { @@ -403,9 +390,8 @@ public static ExpressRouteCircuitsRoutesTableListResult ListRoutesTable(this IEx } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -414,7 +400,7 @@ public static ExpressRouteCircuitsRoutesTableListResult ListRoutesTable(this IEx /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -424,13 +410,12 @@ public static ExpressRouteCircuitsRoutesTableListResult ListRoutesTable(this IEx /// public static ExpressRouteCircuitsRoutesTableListResult BeginListRoutesTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -439,7 +424,7 @@ public static ExpressRouteCircuitsRoutesTableListResult BeginListRoutesTable(thi /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -450,7 +435,7 @@ public static ExpressRouteCircuitsRoutesTableListResult BeginListRoutesTable(thi /// /// The cancellation token. /// - public static async Task BeginListRoutesTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginListRoutesTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginListRoutesTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { @@ -459,9 +444,8 @@ public static ExpressRouteCircuitsRoutesTableListResult BeginListRoutesTable(thi } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -470,7 +454,7 @@ public static ExpressRouteCircuitsRoutesTableListResult BeginListRoutesTable(thi /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -480,13 +464,12 @@ public static ExpressRouteCircuitsRoutesTableListResult BeginListRoutesTable(thi /// public static ExpressRouteCircuitsRoutesTableSummaryListResult ListRoutesTableSummary(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -495,7 +478,7 @@ public static ExpressRouteCircuitsRoutesTableSummaryListResult ListRoutesTableSu /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -506,7 +489,7 @@ public static ExpressRouteCircuitsRoutesTableSummaryListResult ListRoutesTableSu /// /// The cancellation token. /// - public static async Task ListRoutesTableSummaryAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task ListRoutesTableSummaryAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { @@ -515,9 +498,8 @@ public static ExpressRouteCircuitsRoutesTableSummaryListResult ListRoutesTableSu } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -526,7 +508,7 @@ public static ExpressRouteCircuitsRoutesTableSummaryListResult ListRoutesTableSu /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -536,13 +518,12 @@ public static ExpressRouteCircuitsRoutesTableSummaryListResult ListRoutesTableSu /// public static ExpressRouteCircuitsRoutesTableSummaryListResult BeginListRoutesTableSummary(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -551,7 +532,7 @@ public static ExpressRouteCircuitsRoutesTableSummaryListResult BeginListRoutesTa /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -562,7 +543,7 @@ public static ExpressRouteCircuitsRoutesTableSummaryListResult BeginListRoutesTa /// /// The cancellation token. /// - public static async Task BeginListRoutesTableSummaryAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginListRoutesTableSummaryAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { @@ -571,8 +552,7 @@ public static ExpressRouteCircuitsRoutesTableSummaryListResult BeginListRoutesTa } /// - /// The List stats ExpressRouteCircuit operation retrieves all the stats from - /// a ExpressRouteCircuits in a resource group. + /// Gets all the stats from an express route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -581,16 +561,15 @@ public static ExpressRouteCircuitsRoutesTableSummaryListResult BeginListRoutesTa /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// public static ExpressRouteCircuitStats GetStats(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).GetStatsAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).GetStatsAsync(resourceGroupName, circuitName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List stats ExpressRouteCircuit operation retrieves all the stats from - /// a ExpressRouteCircuits in a resource group. + /// Gets all the stats from an express route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -599,12 +578,12 @@ public static ExpressRouteCircuitStats GetStats(this IExpressRouteCircuitsOperat /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The cancellation token. /// - public static async Task GetStatsAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetStatsAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetStatsWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) { @@ -613,8 +592,7 @@ public static ExpressRouteCircuitStats GetStats(this IExpressRouteCircuitsOperat } /// - /// The List stats ExpressRouteCircuit operation retrieves all the stats from - /// a ExpressRouteCircuits in a resource group. + /// Gets all stats from an express route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -623,19 +601,18 @@ public static ExpressRouteCircuitStats GetStats(this IExpressRouteCircuitsOperat /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. /// public static ExpressRouteCircuitStats GetPeeringStats(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).GetPeeringStatsAsync(resourceGroupName, circuitName, peeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).GetPeeringStatsAsync(resourceGroupName, circuitName, peeringName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List stats ExpressRouteCircuit operation retrieves all the stats from - /// a ExpressRouteCircuits in a resource group. + /// Gets all stats from an express route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -644,7 +621,7 @@ public static ExpressRouteCircuitStats GetPeeringStats(this IExpressRouteCircuit /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -652,7 +629,7 @@ public static ExpressRouteCircuitStats GetPeeringStats(this IExpressRouteCircuit /// /// The cancellation token. /// - public static async Task GetPeeringStatsAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetPeeringStatsAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetPeeringStatsWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)) { @@ -661,8 +638,7 @@ public static ExpressRouteCircuitStats GetPeeringStats(this IExpressRouteCircuit } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a resource group. + /// Gets all the express route circuits in a resource group. /// /// /// The operations group for this extension method. @@ -670,14 +646,13 @@ public static ExpressRouteCircuitStats GetPeeringStats(this IExpressRouteCircuit /// /// The name of the resource group. /// - public static IPage List(this IExpressRouteCircuitsOperations operations, string resourceGroupName) + public static Microsoft.Rest.Azure.IPage List(this IExpressRouteCircuitsOperations operations, string resourceGroupName) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a resource group. + /// Gets all the express route circuits in a resource group. /// /// /// The operations group for this extension method. @@ -688,7 +663,7 @@ public static IPage List(this IExpressRouteCircuitsOperatio /// /// The cancellation token. /// - public static async Task> ListAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { @@ -697,20 +672,18 @@ public static IPage List(this IExpressRouteCircuitsOperatio } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a subscription. + /// Gets all the express route circuits in a subscription. /// /// /// The operations group for this extension method. /// - public static IPage ListAll(this IExpressRouteCircuitsOperations operations) + public static Microsoft.Rest.Azure.IPage ListAll(this IExpressRouteCircuitsOperations operations) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListAllAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a subscription. + /// Gets all the express route circuits in a subscription. /// /// /// The operations group for this extension method. @@ -718,7 +691,7 @@ public static IPage ListAll(this IExpressRouteCircuitsOpera /// /// The cancellation token. /// - public static async Task> ListAllAsync(this IExpressRouteCircuitsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllAsync(this IExpressRouteCircuitsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -727,8 +700,7 @@ public static IPage ListAll(this IExpressRouteCircuitsOpera } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a resource group. + /// Gets all the express route circuits in a resource group. /// /// /// The operations group for this extension method. @@ -736,14 +708,13 @@ public static IPage ListAll(this IExpressRouteCircuitsOpera /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this IExpressRouteCircuitsOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListNext(this IExpressRouteCircuitsOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a resource group. + /// Gets all the express route circuits in a resource group. /// /// /// The operations group for this extension method. @@ -754,7 +725,7 @@ public static IPage ListNext(this IExpressRouteCircuitsOper /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IExpressRouteCircuitsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this IExpressRouteCircuitsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -763,8 +734,7 @@ public static IPage ListNext(this IExpressRouteCircuitsOper } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a subscription. + /// Gets all the express route circuits in a subscription. /// /// /// The operations group for this extension method. @@ -772,14 +742,13 @@ public static IPage ListNext(this IExpressRouteCircuitsOper /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListAllNext(this IExpressRouteCircuitsOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListAllNext(this IExpressRouteCircuitsOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListAllNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListAllNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a subscription. + /// Gets all the express route circuits in a subscription. /// /// /// The operations group for this extension method. @@ -790,7 +759,7 @@ public static IPage ListAllNext(this IExpressRouteCircuitsO /// /// The cancellation token. /// - public static async Task> ListAllNextAsync(this IExpressRouteCircuitsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllNextAsync(this IExpressRouteCircuitsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs index f7fc1783e4c92..ef64997d26768 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs @@ -2,32 +2,21 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; using System.Linq; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using Microsoft.Rest.Azure; using Models; /// /// ExpressRouteServiceProvidersOperations operations. /// - internal partial class ExpressRouteServiceProvidersOperations : IServiceOperations, IExpressRouteServiceProvidersOperations + internal partial class ExpressRouteServiceProvidersOperations : Microsoft.Rest.IServiceOperations, IExpressRouteServiceProvidersOperations { /// /// Initializes a new instance of the ExpressRouteServiceProvidersOperations class. @@ -35,11 +24,14 @@ internal partial class ExpressRouteServiceProvidersOperations : IServiceOperatio /// /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) { if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } this.Client = client; } @@ -50,8 +42,7 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The List ExpressRouteServiceProvider operation retrieves all the available - /// ExpressRouteServiceProviders. + /// Gets all the available express route service providers. /// /// /// Headers that will be added to request. @@ -59,51 +50,60 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -136,43 +136,43 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -182,7 +182,7 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -195,28 +195,27 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List ExpressRouteServiceProvider operation retrieves all the available - /// ExpressRouteServiceProviders. + /// Gets all the available express route service providers. /// /// /// The NextLink from the previous successful call to List operation. @@ -227,43 +226,52 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -296,43 +304,43 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -342,7 +350,7 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -355,21 +363,21 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperationsExtensions.cs index f194724add22b..874bb346e49ac 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperationsExtensions.cs @@ -2,20 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; + using Microsoft.Rest.Azure; + using Models; /// /// Extension methods for ExpressRouteServiceProvidersOperations. @@ -23,20 +18,18 @@ namespace Microsoft.Azure.Management.Network public static partial class ExpressRouteServiceProvidersOperationsExtensions { /// - /// The List ExpressRouteServiceProvider operation retrieves all the available - /// ExpressRouteServiceProviders. + /// Gets all the available express route service providers. /// /// /// The operations group for this extension method. /// - public static IPage List(this IExpressRouteServiceProvidersOperations operations) + public static Microsoft.Rest.Azure.IPage List(this IExpressRouteServiceProvidersOperations operations) { - return Task.Factory.StartNew(s => ((IExpressRouteServiceProvidersOperations)s).ListAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteServiceProvidersOperations)s).ListAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List ExpressRouteServiceProvider operation retrieves all the available - /// ExpressRouteServiceProviders. + /// Gets all the available express route service providers. /// /// /// The operations group for this extension method. @@ -44,7 +37,7 @@ public static IPage List(this IExpressRouteServiceP /// /// The cancellation token. /// - public static async Task> ListAsync(this IExpressRouteServiceProvidersOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IExpressRouteServiceProvidersOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -53,8 +46,7 @@ public static IPage List(this IExpressRouteServiceP } /// - /// The List ExpressRouteServiceProvider operation retrieves all the available - /// ExpressRouteServiceProviders. + /// Gets all the available express route service providers. /// /// /// The operations group for this extension method. @@ -62,14 +54,13 @@ public static IPage List(this IExpressRouteServiceP /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this IExpressRouteServiceProvidersOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListNext(this IExpressRouteServiceProvidersOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IExpressRouteServiceProvidersOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteServiceProvidersOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List ExpressRouteServiceProvider operation retrieves all the available - /// ExpressRouteServiceProviders. + /// Gets all the available express route service providers. /// /// /// The operations group for this extension method. @@ -80,7 +71,7 @@ public static IPage ListNext(this IExpressRouteServ /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IExpressRouteServiceProvidersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this IExpressRouteServiceProvidersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IApplicationGatewaysOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IApplicationGatewaysOperations.cs index 8cffebc7f0662..77a0a54ba6f12 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IApplicationGatewaysOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IApplicationGatewaysOperations.cs @@ -2,18 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -23,8 +17,7 @@ namespace Microsoft.Azure.Management.Network public partial interface IApplicationGatewaysOperations { /// - /// The delete ApplicationGateway operation deletes the specified - /// application gateway. + /// Deletes the specified application gateway. /// /// /// The name of the resource group. @@ -38,10 +31,15 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation token. /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The delete ApplicationGateway operation deletes the specified - /// application gateway. + /// Deletes the specified application gateway. /// /// /// The name of the resource group. @@ -55,10 +53,15 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Get ApplicationGateway operation retrieves information about - /// the specified application gateway. + /// Gets the specified application gateway. /// /// /// The name of the resource group. @@ -72,20 +75,28 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put ApplicationGateway operation creates/updates a - /// ApplicationGateway + /// Creates or updates the specified application gateway. /// /// /// The name of the resource group. /// /// - /// The name of the ApplicationGateway. + /// The name of the application gateway. /// /// - /// Parameters supplied to the create/delete ApplicationGateway - /// operation + /// Parameters supplied to the create or update application gateway + /// operation. /// /// /// The headers that will be added to request. @@ -93,20 +104,28 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put ApplicationGateway operation creates/updates a - /// ApplicationGateway + /// Creates or updates the specified application gateway. /// /// /// The name of the resource group. /// /// - /// The name of the ApplicationGateway. + /// The name of the application gateway. /// /// - /// Parameters supplied to the create/delete ApplicationGateway - /// operation + /// Parameters supplied to the create or update application gateway + /// operation. /// /// /// The headers that will be added to request. @@ -114,10 +133,18 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List ApplicationGateway operation retrieves all the - /// application gateways in a resource group. + /// Lists all application gateways in a resource group. /// /// /// The name of the resource group. @@ -128,10 +155,18 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List ApplicationGateway operation retrieves all the - /// application gateways in a subscription. + /// Gets all the application gateways in a subscription. /// /// /// The headers that will be added to request. @@ -139,10 +174,18 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation token. /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Start ApplicationGateway operation starts application gateway - /// in the specified resource group through Network resource provider. + /// Starts the specified application gateway. /// /// /// The name of the resource group. @@ -156,10 +199,15 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation token. /// - Task StartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task StartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Start ApplicationGateway operation starts application gateway - /// in the specified resource group through Network resource provider. + /// Starts the specified application gateway. /// /// /// The name of the resource group. @@ -173,10 +221,15 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation token. /// - Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The STOP ApplicationGateway operation stops application gateway in - /// the specified resource group through Network resource provider. + /// Stops the specified application gateway in a resource group. /// /// /// The name of the resource group. @@ -190,10 +243,15 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation token. /// - Task StopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task StopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The STOP ApplicationGateway operation stops application gateway in - /// the specified resource group through Network resource provider. + /// Stops the specified application gateway in a resource group. /// /// /// The name of the resource group. @@ -207,11 +265,16 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation token. /// - Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The BackendHealth operation gets the backend health of application - /// gateway in the specified resource group through Network resource - /// provider. + /// Gets the backend health of the specified application gateway in a + /// resource group. /// /// /// The name of the resource group. @@ -229,11 +292,19 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation token. /// - Task> BackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The BackendHealth operation gets the backend health of application - /// gateway in the specified resource group through Network resource - /// provider. + /// Gets the backend health of the specified application gateway in a + /// resource group. /// /// /// The name of the resource group. @@ -251,10 +322,18 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation token. /// - Task> BeginBackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginBackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List ApplicationGateway operation retrieves all the - /// application gateways in a resource group. + /// Lists all application gateways in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -265,10 +344,18 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation token. /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List ApplicationGateway operation retrieves all the - /// application gateways in a subscription. + /// Gets all the application gateways in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -279,6 +366,15 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation token. /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitAuthorizationsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitAuthorizationsOperations.cs index 47791b6c045f9..fb5e8b7344e43 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitAuthorizationsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitAuthorizationsOperations.cs @@ -2,18 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -23,8 +17,8 @@ namespace Microsoft.Azure.Management.Network public partial interface IExpressRouteCircuitAuthorizationsOperations { /// - /// The delete authorization operation deletes the specified - /// authorization from the specified ExpressRouteCircuit. + /// Deletes the specified authorization from the specified express + /// route circuit. /// /// /// The name of the resource group. @@ -41,10 +35,16 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// The cancellation token. /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The delete authorization operation deletes the specified - /// authorization from the specified ExpressRouteCircuit. + /// Deletes the specified authorization from the specified express + /// route circuit. /// /// /// The name of the resource group. @@ -61,10 +61,16 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The GET authorization operation retrieves the specified - /// authorization from the specified ExpressRouteCircuit. + /// Gets the specified authorization from the specified express route + /// circuit. /// /// /// The name of the resource group. @@ -81,10 +87,19 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put Authorization operation creates/updates an authorization - /// in the specified ExpressRouteCircuits + /// Creates or updates an authorization in the specified express route + /// circuit. /// /// /// The name of the resource group. @@ -96,8 +111,8 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// The name of the authorization. /// /// - /// Parameters supplied to the create/update - /// ExpressRouteCircuitAuthorization operation + /// Parameters supplied to the create or update express route circuit + /// authorization operation. /// /// /// The headers that will be added to request. @@ -105,10 +120,19 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put Authorization operation creates/updates an authorization - /// in the specified ExpressRouteCircuits + /// Creates or updates an authorization in the specified express route + /// circuit. /// /// /// The name of the resource group. @@ -120,8 +144,8 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// The name of the authorization. /// /// - /// Parameters supplied to the create/update - /// ExpressRouteCircuitAuthorization operation + /// Parameters supplied to the create or update express route circuit + /// authorization operation. /// /// /// The headers that will be added to request. @@ -129,10 +153,18 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List authorization operation retrieves all the authorizations - /// in an ExpressRouteCircuit. + /// Gets all authorizations in an express route circuit. /// /// /// The name of the resource group. @@ -146,10 +178,18 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List authorization operation retrieves all the authorizations - /// in an ExpressRouteCircuit. + /// Gets all authorizations in an express route circuit. /// /// /// The NextLink from the previous successful call to List operation. @@ -160,6 +200,15 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// The cancellation token. /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitPeeringsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitPeeringsOperations.cs index 45d56ff832132..761dde57e452c 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitPeeringsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitPeeringsOperations.cs @@ -2,18 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -23,8 +17,8 @@ namespace Microsoft.Azure.Management.Network public partial interface IExpressRouteCircuitPeeringsOperations { /// - /// The delete peering operation deletes the specified peering from - /// the ExpressRouteCircuit. + /// Deletes the specified peering from the specified express route + /// circuit. /// /// /// The name of the resource group. @@ -41,10 +35,16 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// The cancellation token. /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The delete peering operation deletes the specified peering from - /// the ExpressRouteCircuit. + /// Deletes the specified peering from the specified express route + /// circuit. /// /// /// The name of the resource group. @@ -61,10 +61,16 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The GET peering operation retrieves the specified authorization - /// from the ExpressRouteCircuit. + /// Gets the specified authorization from the specified express route + /// circuit. /// /// /// The name of the resource group. @@ -81,10 +87,19 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put Peering operation creates/updates an peering in the - /// specified ExpressRouteCircuits + /// Creates or updates a peering in the specified express route + /// circuits. /// /// /// The name of the resource group. @@ -96,8 +111,8 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// The name of the peering. /// /// - /// Parameters supplied to the create/update ExpressRouteCircuit - /// Peering operation + /// Parameters supplied to the create or update express route circuit + /// peering operation. /// /// /// The headers that will be added to request. @@ -105,10 +120,19 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put Peering operation creates/updates an peering in the - /// specified ExpressRouteCircuits + /// Creates or updates a peering in the specified express route + /// circuits. /// /// /// The name of the resource group. @@ -120,8 +144,8 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// The name of the peering. /// /// - /// Parameters supplied to the create/update ExpressRouteCircuit - /// Peering operation + /// Parameters supplied to the create or update express route circuit + /// peering operation. /// /// /// The headers that will be added to request. @@ -129,16 +153,24 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List peering operation retrieves all the peerings in an - /// ExpressRouteCircuit. + /// Gets all peerings in a specified express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The headers that will be added to request. @@ -146,10 +178,18 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List peering operation retrieves all the peerings in an - /// ExpressRouteCircuit. + /// Gets all peerings in a specified express route circuit. /// /// /// The NextLink from the previous successful call to List operation. @@ -160,6 +200,15 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// The cancellation token. /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitsOperations.cs index 644ab80a5d3c3..152e526849ab2 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitsOperations.cs @@ -2,18 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -23,14 +17,13 @@ namespace Microsoft.Azure.Management.Network public partial interface IExpressRouteCircuitsOperations { /// - /// The delete ExpressRouteCircuit operation deletes the specified - /// ExpressRouteCircuit. + /// Deletes the specified express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the express route Circuit. + /// The name of the express route circuit. /// /// /// The headers that will be added to request. @@ -38,16 +31,21 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The delete ExpressRouteCircuit operation deletes the specified - /// ExpressRouteCircuit. + /// Deletes the specified express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the express route Circuit. + /// The name of the express route circuit. /// /// /// The headers that will be added to request. @@ -55,16 +53,21 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Get ExpressRouteCircuit operation retrieves information about - /// the specified ExpressRouteCircuit. + /// Gets information about the specified express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of express route circuit. /// /// /// The headers that will be added to request. @@ -72,10 +75,18 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put ExpressRouteCircuit operation creates/updates a - /// ExpressRouteCircuit + /// Creates or updates an express route circuit. /// /// /// The name of the resource group. @@ -84,8 +95,8 @@ public partial interface IExpressRouteCircuitsOperations /// The name of the circuit. /// /// - /// Parameters supplied to the create/delete ExpressRouteCircuit - /// operation + /// Parameters supplied to the create or update express route circuit + /// operation. /// /// /// The headers that will be added to request. @@ -93,10 +104,18 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put ExpressRouteCircuit operation creates/updates a - /// ExpressRouteCircuit + /// Creates or updates an express route circuit. /// /// /// The name of the resource group. @@ -105,8 +124,8 @@ public partial interface IExpressRouteCircuitsOperations /// The name of the circuit. /// /// - /// Parameters supplied to the create/delete ExpressRouteCircuit - /// operation + /// Parameters supplied to the create or update express route circuit + /// operation. /// /// /// The headers that will be added to request. @@ -114,17 +133,25 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The ListArpTable from ExpressRouteCircuit operation retrieves the - /// currently advertised arp table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised ARP table associated with the + /// express route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -138,17 +165,25 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The ListArpTable from ExpressRouteCircuit operation retrieves the - /// currently advertised arp table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised ARP table associated with the + /// express route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -162,17 +197,25 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves - /// the currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table associated with the + /// express route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -186,17 +229,25 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves - /// the currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table associated with the + /// express route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -210,17 +261,25 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves - /// the currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table summary associated with + /// the express route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -234,17 +293,25 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves - /// the currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table summary associated with + /// the express route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -258,16 +325,25 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List stats ExpressRouteCircuit operation retrieves all the - /// stats from a ExpressRouteCircuits in a resource group. + /// Gets all the stats from an express route circuit in a resource + /// group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The headers that will be added to request. @@ -275,16 +351,24 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task> GetStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List stats ExpressRouteCircuit operation retrieves all the - /// stats from a ExpressRouteCircuits in a resource group. + /// Gets all stats from an express route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -295,10 +379,18 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task> GetPeeringStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetPeeringStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a resource group. + /// Gets all the express route circuits in a resource group. /// /// /// The name of the resource group. @@ -309,10 +401,18 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a subscription. + /// Gets all the express route circuits in a subscription. /// /// /// The headers that will be added to request. @@ -320,10 +420,18 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a resource group. + /// Gets all the express route circuits in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -334,10 +442,18 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a subscription. + /// Gets all the express route circuits in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -348,6 +464,15 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteServiceProvidersOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteServiceProvidersOperations.cs index ff765a95b6d9b..04dc0e8cecc24 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteServiceProvidersOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteServiceProvidersOperations.cs @@ -2,18 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -23,8 +17,7 @@ namespace Microsoft.Azure.Management.Network public partial interface IExpressRouteServiceProvidersOperations { /// - /// The List ExpressRouteServiceProvider operation retrieves all the - /// available ExpressRouteServiceProviders. + /// Gets all the available express route service providers. /// /// /// The headers that will be added to request. @@ -32,10 +25,18 @@ public partial interface IExpressRouteServiceProvidersOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List ExpressRouteServiceProvider operation retrieves all the - /// available ExpressRouteServiceProviders. + /// Gets all the available express route service providers. /// /// /// The NextLink from the previous successful call to List operation. @@ -46,6 +47,15 @@ public partial interface IExpressRouteServiceProvidersOperations /// /// The cancellation token. /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILoadBalancersOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILoadBalancersOperations.cs index 5afcbdc831b9f..36e3e588c49cf 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILoadBalancersOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILoadBalancersOperations.cs @@ -2,18 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -23,14 +17,13 @@ namespace Microsoft.Azure.Management.Network public partial interface ILoadBalancersOperations { /// - /// The delete LoadBalancer operation deletes the specified load - /// balancer. + /// Deletes the specified load balancer. /// /// /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// /// The headers that will be added to request. @@ -38,16 +31,21 @@ public partial interface ILoadBalancersOperations /// /// The cancellation token. /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The delete LoadBalancer operation deletes the specified load - /// balancer. + /// Deletes the specified load balancer. /// /// /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// /// The headers that will be added to request. @@ -55,19 +53,24 @@ public partial interface ILoadBalancersOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Get LoadBalancer operation retrieves information about the - /// specified LoadBalancer. + /// Gets the specified load balancer. /// /// /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// The headers that will be added to request. @@ -75,18 +78,28 @@ public partial interface ILoadBalancersOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put LoadBalancer operation creates/updates a LoadBalancer + /// Creates or updates a load balancer. /// /// /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// - /// Parameters supplied to the create/delete LoadBalancer operation + /// Parameters supplied to the create or update load balancer + /// operation. /// /// /// The headers that will be added to request. @@ -94,18 +107,28 @@ public partial interface ILoadBalancersOperations /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put LoadBalancer operation creates/updates a LoadBalancer + /// Creates or updates a load balancer. /// /// /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// - /// Parameters supplied to the create/delete LoadBalancer operation + /// Parameters supplied to the create or update load balancer + /// operation. /// /// /// The headers that will be added to request. @@ -113,10 +136,18 @@ public partial interface ILoadBalancersOperations /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List loadBalancer operation retrieves all the load balancers - /// in a subscription. + /// Gets all the load balancers in a subscription. /// /// /// The headers that will be added to request. @@ -124,10 +155,18 @@ public partial interface ILoadBalancersOperations /// /// The cancellation token. /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List loadBalancer operation retrieves all the load balancers - /// in a resource group. + /// Gets all the load balancers in a resource group. /// /// /// The name of the resource group. @@ -138,10 +177,18 @@ public partial interface ILoadBalancersOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List loadBalancer operation retrieves all the load balancers - /// in a subscription. + /// Gets all the load balancers in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -152,10 +199,18 @@ public partial interface ILoadBalancersOperations /// /// The cancellation token. /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List loadBalancer operation retrieves all the load balancers - /// in a resource group. + /// Gets all the load balancers in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -166,6 +221,15 @@ public partial interface ILoadBalancersOperations /// /// The cancellation token. /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILocalNetworkGatewaysOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILocalNetworkGatewaysOperations.cs index 63013a234ec46..a0c15591abba3 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILocalNetworkGatewaysOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILocalNetworkGatewaysOperations.cs @@ -2,18 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -23,9 +17,8 @@ namespace Microsoft.Azure.Management.Network public partial interface ILocalNetworkGatewaysOperations { /// - /// The Put LocalNetworkGateway operation creates/updates a local - /// network gateway in the specified resource group through Network - /// resource provider. + /// Creates or updates a local network gateway in the specified + /// resource group. /// /// /// The name of the resource group. @@ -34,8 +27,8 @@ public partial interface ILocalNetworkGatewaysOperations /// The name of the local network gateway. /// /// - /// Parameters supplied to the Begin Create or update Local Network - /// Gateway operation through Network resource provider. + /// Parameters supplied to the create or update local network gateway + /// operation. /// /// /// The headers that will be added to request. @@ -43,11 +36,19 @@ public partial interface ILocalNetworkGatewaysOperations /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put LocalNetworkGateway operation creates/updates a local - /// network gateway in the specified resource group through Network - /// resource provider. + /// Creates or updates a local network gateway in the specified + /// resource group. /// /// /// The name of the resource group. @@ -56,8 +57,8 @@ public partial interface ILocalNetworkGatewaysOperations /// The name of the local network gateway. /// /// - /// Parameters supplied to the Begin Create or update Local Network - /// Gateway operation through Network resource provider. + /// Parameters supplied to the create or update local network gateway + /// operation. /// /// /// The headers that will be added to request. @@ -65,11 +66,18 @@ public partial interface ILocalNetworkGatewaysOperations /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Get LocalNetworkGateway operation retrieves information about - /// the specified local network gateway through Network resource - /// provider. + /// Gets the specified local network gateway in a resource group. /// /// /// The name of the resource group. @@ -83,10 +91,18 @@ public partial interface ILocalNetworkGatewaysOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Delete LocalNetworkGateway operation deletes the specified - /// local network Gateway through Network resource provider. + /// Deletes the specified local network gateway. /// /// /// The name of the resource group. @@ -100,10 +116,15 @@ public partial interface ILocalNetworkGatewaysOperations /// /// The cancellation token. /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Delete LocalNetworkGateway operation deletes the specified - /// local network Gateway through Network resource provider. + /// Deletes the specified local network gateway. /// /// /// The name of the resource group. @@ -117,10 +138,15 @@ public partial interface ILocalNetworkGatewaysOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List LocalNetworkGateways operation retrieves all the local - /// network gateways stored. + /// Gets all the local network gateways in a resource group. /// /// /// The name of the resource group. @@ -131,10 +157,18 @@ public partial interface ILocalNetworkGatewaysOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List LocalNetworkGateways operation retrieves all the local - /// network gateways stored. + /// Gets all the local network gateways in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -145,6 +179,15 @@ public partial interface ILocalNetworkGatewaysOperations /// /// The cancellation token. /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkInterfacesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkInterfacesOperations.cs index a12bce9886ca6..34e9adae4a631 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkInterfacesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkInterfacesOperations.cs @@ -2,18 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -23,8 +17,7 @@ namespace Microsoft.Azure.Management.Network public partial interface INetworkInterfacesOperations { /// - /// The delete netwokInterface operation deletes the specified - /// netwokInterface. + /// Deletes the specified network interface. /// /// /// The name of the resource group. @@ -38,10 +31,15 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The delete netwokInterface operation deletes the specified - /// netwokInterface. + /// Deletes the specified network interface. /// /// /// The name of the resource group. @@ -55,10 +53,15 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Get network interface operation retrieves information about - /// the specified network interface. + /// Gets information about the specified network interface. /// /// /// The name of the resource group. @@ -67,7 +70,7 @@ public partial interface INetworkInterfacesOperations /// The name of the network interface. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// The headers that will be added to request. @@ -75,10 +78,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put NetworkInterface operation creates/updates a - /// networkInterface + /// Creates or updates a network interface. /// /// /// The name of the resource group. @@ -87,7 +98,8 @@ public partial interface INetworkInterfacesOperations /// The name of the network interface. /// /// - /// Parameters supplied to the create/update NetworkInterface operation + /// Parameters supplied to the create or update network interface + /// operation. /// /// /// The headers that will be added to request. @@ -95,10 +107,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put NetworkInterface operation creates/updates a - /// networkInterface + /// Creates or updates a network interface. /// /// /// The name of the resource group. @@ -107,7 +127,8 @@ public partial interface INetworkInterfacesOperations /// The name of the network interface. /// /// - /// Parameters supplied to the create/update NetworkInterface operation + /// Parameters supplied to the create or update network interface + /// operation. /// /// /// The headers that will be added to request. @@ -115,11 +136,19 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The list network interface operation retrieves information about - /// all network interfaces in a virtual machine from a virtual - /// machine scale set. + /// Gets information about all network interfaces in a virtual machine + /// in a virtual machine scale set. /// /// /// The name of the resource group. @@ -136,10 +165,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// - Task>> ListVirtualMachineScaleSetVMNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListVirtualMachineScaleSetVMNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The list network interface operation retrieves information about - /// all network interfaces in a virtual machine scale set. + /// Gets all network interfaces in a virtual machine scale set. /// /// /// The name of the resource group. @@ -153,10 +190,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// - Task>> ListVirtualMachineScaleSetNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListVirtualMachineScaleSetNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Get network interface operation retrieves information about - /// the specified network interface in a virtual machine scale set. + /// Get the specified network interface in a virtual machine scale set. /// /// /// The name of the resource group. @@ -171,7 +216,7 @@ public partial interface INetworkInterfacesOperations /// The name of the network interface. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// The headers that will be added to request. @@ -179,10 +224,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// - Task> GetVirtualMachineScaleSetNetworkInterfaceWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetVirtualMachineScaleSetNetworkInterfaceWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List networkInterfaces operation retrieves all the - /// networkInterfaces in a subscription. + /// Gets all network interfaces in a subscription. /// /// /// The headers that will be added to request. @@ -190,10 +243,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List networkInterfaces operation retrieves all the - /// networkInterfaces in a resource group. + /// Gets all network interfaces in a resource group. /// /// /// The name of the resource group. @@ -204,10 +265,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The get effective routetable operation retrieves all the route - /// tables applied on a networkInterface. + /// Gets all route tables applied to a network interface. /// /// /// The name of the resource group. @@ -221,10 +290,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// - Task> GetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The get effective routetable operation retrieves all the route - /// tables applied on a networkInterface. + /// Gets all route tables applied to a network interface. /// /// /// The name of the resource group. @@ -238,10 +315,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// - Task> BeginGetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginGetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The list effective network security group operation retrieves all - /// the network security groups applied on a networkInterface. + /// Gets all network security groups applied to a network interface. /// /// /// The name of the resource group. @@ -255,10 +340,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// - Task> ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The list effective network security group operation retrieves all - /// the network security groups applied on a networkInterface. + /// Gets all network security groups applied to a network interface. /// /// /// The name of the resource group. @@ -272,11 +365,19 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// - Task> BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The list network interface operation retrieves information about - /// all network interfaces in a virtual machine from a virtual - /// machine scale set. + /// Gets information about all network interfaces in a virtual machine + /// in a virtual machine scale set. /// /// /// The NextLink from the previous successful call to List operation. @@ -287,10 +388,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// - Task>> ListVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The list network interface operation retrieves information about - /// all network interfaces in a virtual machine scale set. + /// Gets all network interfaces in a virtual machine scale set. /// /// /// The NextLink from the previous successful call to List operation. @@ -301,10 +410,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// - Task>> ListVirtualMachineScaleSetNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListVirtualMachineScaleSetNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List networkInterfaces operation retrieves all the - /// networkInterfaces in a subscription. + /// Gets all network interfaces in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -315,10 +432,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List networkInterfaces operation retrieves all the - /// networkInterfaces in a resource group. + /// Gets all network interfaces in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -329,6 +454,15 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkManagementClient.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkManagementClient.cs index 8b6d6b612123a..c738bd4572e14 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkManagementClient.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkManagementClient.cs @@ -2,18 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Newtonsoft.Json; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -25,37 +19,37 @@ namespace Microsoft.Azure.Management.Network /// relationship between an end user and the Microsoft Azure Networks /// service. /// - public partial interface INetworkManagementClient : IDisposable + public partial interface INetworkManagementClient : System.IDisposable { /// /// The base URI of the service. /// - Uri BaseUri { get; set; } + System.Uri BaseUri { get; set; } /// /// Gets or sets json serialization settings. /// - JsonSerializerSettings SerializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - JsonSerializerSettings DeserializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } /// - /// Gets Azure subscription credentials. + /// Credentials needed for the client to connect to Azure. /// - ServiceClientCredentials Credentials { get; } + Microsoft.Rest.ServiceClientCredentials Credentials { get; } /// - /// Gets subscription credentials which uniquely identify Microsoft + /// The subscription credentials which uniquely identify the Microsoft /// Azure subscription. The subscription ID forms part of the URI for /// every service call. /// string SubscriptionId { get; set; } /// - /// Client Api Version. + /// Client API version. /// string ApiVersion { get; } @@ -177,7 +171,7 @@ public partial interface INetworkManagementClient : IDisposable /// for use. /// /// - /// The location of the domain name + /// The location of the domain name. /// /// /// The domain name to be verified. It must conform to the following @@ -189,7 +183,7 @@ public partial interface INetworkManagementClient : IDisposable /// /// The cancellation token. /// - Task> CheckDnsNameAvailabilityWithHttpMessagesAsync(string location, string domainNameLabel = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CheckDnsNameAvailabilityWithHttpMessagesAsync(string location, string domainNameLabel = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkSecurityGroupsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkSecurityGroupsOperations.cs index 74cbec4c0da83..d7b692ae5ecc0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkSecurityGroupsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkSecurityGroupsOperations.cs @@ -2,18 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -23,8 +17,7 @@ namespace Microsoft.Azure.Management.Network public partial interface INetworkSecurityGroupsOperations { /// - /// The Delete NetworkSecurityGroup operation deletes the specified - /// network security group + /// Deletes the specified network security group. /// /// /// The name of the resource group. @@ -38,10 +31,15 @@ public partial interface INetworkSecurityGroupsOperations /// /// The cancellation token. /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Delete NetworkSecurityGroup operation deletes the specified - /// network security group + /// Deletes the specified network security group. /// /// /// The name of the resource group. @@ -55,10 +53,15 @@ public partial interface INetworkSecurityGroupsOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Get NetworkSecurityGroups operation retrieves information - /// about the specified network security group. + /// Gets the specified network security group. /// /// /// The name of the resource group. @@ -67,7 +70,7 @@ public partial interface INetworkSecurityGroupsOperations /// The name of the network security group. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// The headers that will be added to request. @@ -75,10 +78,19 @@ public partial interface INetworkSecurityGroupsOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put NetworkSecurityGroup operation creates/updates a network - /// security group in the specified resource group. + /// Creates or updates a network security group in the specified + /// resource group. /// /// /// The name of the resource group. @@ -87,8 +99,8 @@ public partial interface INetworkSecurityGroupsOperations /// The name of the network security group. /// /// - /// Parameters supplied to the create/update Network Security Group - /// operation + /// Parameters supplied to the create or update network security group + /// operation. /// /// /// The headers that will be added to request. @@ -96,10 +108,19 @@ public partial interface INetworkSecurityGroupsOperations /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put NetworkSecurityGroup operation creates/updates a network - /// security group in the specified resource group. + /// Creates or updates a network security group in the specified + /// resource group. /// /// /// The name of the resource group. @@ -108,8 +129,8 @@ public partial interface INetworkSecurityGroupsOperations /// The name of the network security group. /// /// - /// Parameters supplied to the create/update Network Security Group - /// operation + /// Parameters supplied to the create or update network security group + /// operation. /// /// /// The headers that will be added to request. @@ -117,10 +138,18 @@ public partial interface INetworkSecurityGroupsOperations /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The list NetworkSecurityGroups returns all network security groups - /// in a subscription + /// Gets all network security groups in a subscription. /// /// /// The headers that will be added to request. @@ -128,10 +157,18 @@ public partial interface INetworkSecurityGroupsOperations /// /// The cancellation token. /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The list NetworkSecurityGroups returns all network security groups - /// in a resource group + /// Gets all network security groups in a resource group. /// /// /// The name of the resource group. @@ -142,10 +179,18 @@ public partial interface INetworkSecurityGroupsOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The list NetworkSecurityGroups returns all network security groups - /// in a subscription + /// Gets all network security groups in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -156,10 +201,18 @@ public partial interface INetworkSecurityGroupsOperations /// /// The cancellation token. /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The list NetworkSecurityGroups returns all network security groups - /// in a resource group + /// Gets all network security groups in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -170,6 +223,15 @@ public partial interface INetworkSecurityGroupsOperations /// /// The cancellation token. /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IPublicIpAddressesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IPublicIpAddressesOperations.cs index 12ff1c26a2d00..07daf5cf2aec8 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IPublicIpAddressesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IPublicIpAddressesOperations.cs @@ -2,18 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -23,8 +17,7 @@ namespace Microsoft.Azure.Management.Network public partial interface IPublicIPAddressesOperations { /// - /// The delete publicIpAddress operation deletes the specified - /// publicIpAddress. + /// Deletes the specified public IP address. /// /// /// The name of the resource group. @@ -38,10 +31,15 @@ public partial interface IPublicIPAddressesOperations /// /// The cancellation token. /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The delete publicIpAddress operation deletes the specified - /// publicIpAddress. + /// Deletes the specified public IP address. /// /// /// The name of the resource group. @@ -55,10 +53,15 @@ public partial interface IPublicIPAddressesOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Get publicIpAddress operation retrieves information about the - /// specified pubicIpAddress + /// Gets the specified public IP address in a specified resource group. /// /// /// The name of the resource group. @@ -67,7 +70,7 @@ public partial interface IPublicIPAddressesOperations /// The name of the subnet. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// The headers that will be added to request. @@ -75,19 +78,28 @@ public partial interface IPublicIPAddressesOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put PublicIPAddress operation creates/updates a stable/dynamic - /// PublicIP address + /// Creates or updates a static or dynamic public IP address. /// /// /// The name of the resource group. /// /// - /// The name of the publicIpAddress. + /// The name of the public IP address. /// /// - /// Parameters supplied to the create/update PublicIPAddress operation + /// Parameters supplied to the create or update public IP address + /// operation. /// /// /// The headers that will be added to request. @@ -95,19 +107,28 @@ public partial interface IPublicIPAddressesOperations /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put PublicIPAddress operation creates/updates a stable/dynamic - /// PublicIP address + /// Creates or updates a static or dynamic public IP address. /// /// /// The name of the resource group. /// /// - /// The name of the publicIpAddress. + /// The name of the public IP address. /// /// - /// Parameters supplied to the create/update PublicIPAddress operation + /// Parameters supplied to the create or update public IP address + /// operation. /// /// /// The headers that will be added to request. @@ -115,10 +136,18 @@ public partial interface IPublicIPAddressesOperations /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List publicIpAddress operation retrieves all the - /// publicIpAddresses in a subscription. + /// Gets all the public IP addresses in a subscription. /// /// /// The headers that will be added to request. @@ -126,10 +155,18 @@ public partial interface IPublicIPAddressesOperations /// /// The cancellation token. /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List publicIpAddress operation retrieves all the - /// publicIpAddresses in a resource group. + /// Gets all public IP addresses in a resource group. /// /// /// The name of the resource group. @@ -140,10 +177,18 @@ public partial interface IPublicIPAddressesOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List publicIpAddress operation retrieves all the - /// publicIpAddresses in a subscription. + /// Gets all the public IP addresses in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -154,10 +199,18 @@ public partial interface IPublicIPAddressesOperations /// /// The cancellation token. /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List publicIpAddress operation retrieves all the - /// publicIpAddresses in a resource group. + /// Gets all public IP addresses in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -168,6 +221,15 @@ public partial interface IPublicIPAddressesOperations /// /// The cancellation token. /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRouteTablesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRouteTablesOperations.cs index cdcf9ccee6060..76ba58f4f0f71 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRouteTablesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRouteTablesOperations.cs @@ -2,18 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -23,7 +17,7 @@ namespace Microsoft.Azure.Management.Network public partial interface IRouteTablesOperations { /// - /// The Delete RouteTable operation deletes the specified Route Table + /// Deletes the specified route table. /// /// /// The name of the resource group. @@ -37,9 +31,15 @@ public partial interface IRouteTablesOperations /// /// The cancellation token. /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Delete RouteTable operation deletes the specified Route Table + /// Deletes the specified route table. /// /// /// The name of the resource group. @@ -53,10 +53,15 @@ public partial interface IRouteTablesOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Get RouteTables operation retrieves information about the - /// specified route table. + /// Gets the specified route table. /// /// /// The name of the resource group. @@ -65,7 +70,7 @@ public partial interface IRouteTablesOperations /// The name of the route table. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// The headers that will be added to request. @@ -73,10 +78,18 @@ public partial interface IRouteTablesOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put RouteTable operation creates/updates a route table in the - /// specified resource group. + /// Create or updates a route table in a specified resource group. /// /// /// The name of the resource group. @@ -85,7 +98,7 @@ public partial interface IRouteTablesOperations /// The name of the route table. /// /// - /// Parameters supplied to the create/update Route Table operation + /// Parameters supplied to the create or update route table operation. /// /// /// The headers that will be added to request. @@ -93,10 +106,18 @@ public partial interface IRouteTablesOperations /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put RouteTable operation creates/updates a route table in the - /// specified resource group. + /// Create or updates a route table in a specified resource group. /// /// /// The name of the resource group. @@ -105,7 +126,7 @@ public partial interface IRouteTablesOperations /// The name of the route table. /// /// - /// Parameters supplied to the create/update Route Table operation + /// Parameters supplied to the create or update route table operation. /// /// /// The headers that will be added to request. @@ -113,9 +134,18 @@ public partial interface IRouteTablesOperations /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The list RouteTables returns all route tables in a resource group + /// Gets all route tables in a resource group. /// /// /// The name of the resource group. @@ -126,9 +156,18 @@ public partial interface IRouteTablesOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The list RouteTables returns all route tables in a subscription + /// Gets all route tables in a subscription. /// /// /// The headers that will be added to request. @@ -136,9 +175,18 @@ public partial interface IRouteTablesOperations /// /// The cancellation token. /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The list RouteTables returns all route tables in a resource group + /// Gets all route tables in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -149,9 +197,18 @@ public partial interface IRouteTablesOperations /// /// The cancellation token. /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The list RouteTables returns all route tables in a subscription + /// Gets all route tables in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -162,6 +219,15 @@ public partial interface IRouteTablesOperations /// /// The cancellation token. /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRoutesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRoutesOperations.cs index d79019b534b1e..88c7c1afc1a09 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRoutesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRoutesOperations.cs @@ -2,18 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -23,8 +17,7 @@ namespace Microsoft.Azure.Management.Network public partial interface IRoutesOperations { /// - /// The delete route operation deletes the specified route from a - /// route table. + /// Deletes the specified route from a route table. /// /// /// The name of the resource group. @@ -41,10 +34,15 @@ public partial interface IRoutesOperations /// /// The cancellation token. /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The delete route operation deletes the specified route from a - /// route table. + /// Deletes the specified route from a route table. /// /// /// The name of the resource group. @@ -61,10 +59,15 @@ public partial interface IRoutesOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Get route operation retrieves information about the specified - /// route from the route table. + /// Gets the specified route from a route table. /// /// /// The name of the resource group. @@ -81,10 +84,18 @@ public partial interface IRoutesOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put route operation creates/updates a route in the specified - /// route table + /// Creates or updates a route in the specified route table. /// /// /// The name of the resource group. @@ -96,7 +107,7 @@ public partial interface IRoutesOperations /// The name of the route. /// /// - /// Parameters supplied to the create/update route operation + /// Parameters supplied to the create or update route operation. /// /// /// The headers that will be added to request. @@ -104,10 +115,18 @@ public partial interface IRoutesOperations /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put route operation creates/updates a route in the specified - /// route table + /// Creates or updates a route in the specified route table. /// /// /// The name of the resource group. @@ -119,7 +138,7 @@ public partial interface IRoutesOperations /// The name of the route. /// /// - /// Parameters supplied to the create/update route operation + /// Parameters supplied to the create or update route operation. /// /// /// The headers that will be added to request. @@ -127,10 +146,18 @@ public partial interface IRoutesOperations /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List network security rule operation retrieves all the routes - /// in a route table. + /// Gets all routes in a route table. /// /// /// The name of the resource group. @@ -144,10 +171,18 @@ public partial interface IRoutesOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List network security rule operation retrieves all the routes - /// in a route table. + /// Gets all routes in a route table. /// /// /// The NextLink from the previous successful call to List operation. @@ -158,6 +193,15 @@ public partial interface IRoutesOperations /// /// The cancellation token. /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISecurityRulesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISecurityRulesOperations.cs index 431accdfbe8ad..c7fe04e31810f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISecurityRulesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISecurityRulesOperations.cs @@ -2,18 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -23,8 +17,7 @@ namespace Microsoft.Azure.Management.Network public partial interface ISecurityRulesOperations { /// - /// The delete network security rule operation deletes the specified - /// network security rule. + /// Deletes the specified network security rule. /// /// /// The name of the resource group. @@ -41,10 +34,15 @@ public partial interface ISecurityRulesOperations /// /// The cancellation token. /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The delete network security rule operation deletes the specified - /// network security rule. + /// Deletes the specified network security rule. /// /// /// The name of the resource group. @@ -61,10 +59,15 @@ public partial interface ISecurityRulesOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Get NetworkSecurityRule operation retrieves information about - /// the specified network security rule. + /// Get the specified network security rule. /// /// /// The name of the resource group. @@ -81,10 +84,19 @@ public partial interface ISecurityRulesOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put network security rule operation creates/updates a security - /// rule in the specified network security group + /// Creates or updates a security rule in the specified network + /// security group. /// /// /// The name of the resource group. @@ -96,8 +108,8 @@ public partial interface ISecurityRulesOperations /// The name of the security rule. /// /// - /// Parameters supplied to the create/update network security rule - /// operation + /// Parameters supplied to the create or update network security rule + /// operation. /// /// /// The headers that will be added to request. @@ -105,10 +117,19 @@ public partial interface ISecurityRulesOperations /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put network security rule operation creates/updates a security - /// rule in the specified network security group + /// Creates or updates a security rule in the specified network + /// security group. /// /// /// The name of the resource group. @@ -120,8 +141,8 @@ public partial interface ISecurityRulesOperations /// The name of the security rule. /// /// - /// Parameters supplied to the create/update network security rule - /// operation + /// Parameters supplied to the create or update network security rule + /// operation. /// /// /// The headers that will be added to request. @@ -129,10 +150,18 @@ public partial interface ISecurityRulesOperations /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List network security rule operation retrieves all the - /// security rules in a network security group. + /// Gets all security rules in a network security group. /// /// /// The name of the resource group. @@ -146,10 +175,18 @@ public partial interface ISecurityRulesOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List network security rule operation retrieves all the - /// security rules in a network security group. + /// Gets all security rules in a network security group. /// /// /// The NextLink from the previous successful call to List operation. @@ -160,6 +197,15 @@ public partial interface ISecurityRulesOperations /// /// The cancellation token. /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISubnetsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISubnetsOperations.cs index f27260f223116..34a0739ee14c8 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISubnetsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISubnetsOperations.cs @@ -2,18 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -23,7 +17,7 @@ namespace Microsoft.Azure.Management.Network public partial interface ISubnetsOperations { /// - /// The delete subnet operation deletes the specified subnet. + /// Deletes the specified subnet. /// /// /// The name of the resource group. @@ -40,9 +34,15 @@ public partial interface ISubnetsOperations /// /// The cancellation token. /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The delete subnet operation deletes the specified subnet. + /// Deletes the specified subnet. /// /// /// The name of the resource group. @@ -59,10 +59,15 @@ public partial interface ISubnetsOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Get subnet operation retrieves information about the specified - /// subnet. + /// Gets the specified subnet by virtual network and resource group. /// /// /// The name of the resource group. @@ -74,7 +79,7 @@ public partial interface ISubnetsOperations /// The name of the subnet. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// The headers that will be added to request. @@ -82,10 +87,18 @@ public partial interface ISubnetsOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put Subnet operation creates/updates a subnet in the specified - /// virtual network + /// Creates or updates a subnet in the specified virtual network. /// /// /// The name of the resource group. @@ -97,7 +110,7 @@ public partial interface ISubnetsOperations /// The name of the subnet. /// /// - /// Parameters supplied to the create/update Subnet operation + /// Parameters supplied to the create or update subnet operation. /// /// /// The headers that will be added to request. @@ -105,10 +118,18 @@ public partial interface ISubnetsOperations /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put Subnet operation creates/updates a subnet in the specified - /// virtual network + /// Creates or updates a subnet in the specified virtual network. /// /// /// The name of the resource group. @@ -120,7 +141,7 @@ public partial interface ISubnetsOperations /// The name of the subnet. /// /// - /// Parameters supplied to the create/update Subnet operation + /// Parameters supplied to the create or update subnet operation. /// /// /// The headers that will be added to request. @@ -128,10 +149,18 @@ public partial interface ISubnetsOperations /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List subnets operation retrieves all the subnets in a virtual - /// network. + /// Gets all subnets in a virtual network. /// /// /// The name of the resource group. @@ -145,10 +174,18 @@ public partial interface ISubnetsOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List subnets operation retrieves all the subnets in a virtual - /// network. + /// Gets all subnets in a virtual network. /// /// /// The NextLink from the previous successful call to List operation. @@ -159,6 +196,15 @@ public partial interface ISubnetsOperations /// /// The cancellation token. /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IUsagesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IUsagesOperations.cs index 3895bb0359582..c0a72fa8723f2 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IUsagesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IUsagesOperations.cs @@ -2,18 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -26,7 +20,7 @@ public partial interface IUsagesOperations /// Lists compute usages for a subscription. /// /// - /// The location upon which resource usage is queried. + /// The location where resource usage is queried. /// /// /// The headers that will be added to request. @@ -34,7 +28,16 @@ public partial interface IUsagesOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Lists compute usages for a subscription. /// @@ -47,6 +50,15 @@ public partial interface IUsagesOperations /// /// The cancellation token. /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewayConnectionsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewayConnectionsOperations.cs index e2e3b8a44d98e..34b33f9000470 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewayConnectionsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewayConnectionsOperations.cs @@ -2,18 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -23,9 +17,8 @@ namespace Microsoft.Azure.Management.Network public partial interface IVirtualNetworkGatewayConnectionsOperations { /// - /// The Put VirtualNetworkGatewayConnection operation creates/updates - /// a virtual network gateway connection in the specified resource - /// group through Network resource provider. + /// Creates or updates a virtual network gateway connection in the + /// specified resource group. /// /// /// The name of the resource group. @@ -34,8 +27,8 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// The name of the virtual network gateway connection. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network - /// Gateway connection operation through Network resource provider. + /// Parameters supplied to the create or update virtual network + /// gateway connection operation. /// /// /// The headers that will be added to request. @@ -43,11 +36,19 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put VirtualNetworkGatewayConnection operation creates/updates - /// a virtual network gateway connection in the specified resource - /// group through Network resource provider. + /// Creates or updates a virtual network gateway connection in the + /// specified resource group. /// /// /// The name of the resource group. @@ -56,8 +57,8 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// The name of the virtual network gateway connection. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network - /// Gateway connection operation through Network resource provider. + /// Parameters supplied to the create or update virtual network + /// gateway connection operation. /// /// /// The headers that will be added to request. @@ -65,11 +66,19 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Get VirtualNetworkGatewayConnection operation retrieves - /// information about the specified virtual network gateway - /// connection through Network resource provider. + /// Gets the specified virtual network gateway connection by resource + /// group. /// /// /// The name of the resource group. @@ -83,11 +92,18 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Delete VirtualNetworkGatewayConnection operation deletes the - /// specified virtual network Gateway connection through Network - /// resource provider. + /// Deletes the specified virtual network Gateway connection. /// /// /// The name of the resource group. @@ -101,11 +117,15 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Delete VirtualNetworkGatewayConnection operation deletes the - /// specified virtual network Gateway connection through Network - /// resource provider. + /// Deletes the specified virtual network Gateway connection. /// /// /// The name of the resource group. @@ -119,7 +139,13 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets /// the virtual network gateway connection shared key for passed @@ -142,7 +168,16 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - Task> SetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> SetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets /// the virtual network gateway connection shared key for passed @@ -165,7 +200,16 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - Task> BeginSetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginSetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// The Get VirtualNetworkGatewayConnectionSharedKey operation /// retrieves information about the specified virtual network gateway @@ -183,7 +227,16 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - Task> GetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// The List VirtualNetworkGatewayConnections operation retrieves all /// the virtual network gateways connections created. @@ -197,7 +250,16 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets /// the virtual network gateway connection shared key for passed @@ -211,8 +273,8 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the Begin Reset Virtual Network Gateway - /// connection shared key operation through Network resource provider. + /// Parameters supplied to the begin reset virtual network gateway + /// connection shared key operation through network resource provider. /// /// /// The headers that will be added to request. @@ -220,7 +282,16 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - Task> ResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> ResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets /// the virtual network gateway connection shared key for passed @@ -234,8 +305,8 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the Begin Reset Virtual Network Gateway - /// connection shared key operation through Network resource provider. + /// Parameters supplied to the begin reset virtual network gateway + /// connection shared key operation through network resource provider. /// /// /// The headers that will be added to request. @@ -243,7 +314,16 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - Task> BeginResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// The List VirtualNetworkGatewayConnections operation retrieves all /// the virtual network gateways connections created. @@ -257,6 +337,15 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs index 217339d13dc15..72d453d3a8daa 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs @@ -2,18 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -23,9 +17,8 @@ namespace Microsoft.Azure.Management.Network public partial interface IVirtualNetworkGatewaysOperations { /// - /// The Put VirtualNetworkGateway operation creates/updates a virtual - /// network gateway in the specified resource group through Network - /// resource provider. + /// Creates or updates a virtual network gateway in the specified + /// resource group. /// /// /// The name of the resource group. @@ -34,8 +27,8 @@ public partial interface IVirtualNetworkGatewaysOperations /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network - /// Gateway operation through Network resource provider. + /// Parameters supplied to create or update virtual network gateway + /// operation. /// /// /// The headers that will be added to request. @@ -43,11 +36,19 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put VirtualNetworkGateway operation creates/updates a virtual - /// network gateway in the specified resource group through Network - /// resource provider. + /// Creates or updates a virtual network gateway in the specified + /// resource group. /// /// /// The name of the resource group. @@ -56,8 +57,8 @@ public partial interface IVirtualNetworkGatewaysOperations /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network - /// Gateway operation through Network resource provider. + /// Parameters supplied to create or update virtual network gateway + /// operation. /// /// /// The headers that will be added to request. @@ -65,11 +66,18 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Get VirtualNetworkGateway operation retrieves information - /// about the specified virtual network gateway through Network - /// resource provider. + /// Gets the specified virtual network gateway by resource group. /// /// /// The name of the resource group. @@ -83,10 +91,18 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Delete VirtualNetworkGateway operation deletes the specified - /// virtual network Gateway through Network resource provider. + /// Deletes the specified virtual network gateway. /// /// /// The name of the resource group. @@ -100,10 +116,15 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation token. /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Delete VirtualNetworkGateway operation deletes the specified - /// virtual network Gateway through Network resource provider. + /// Deletes the specified virtual network gateway. /// /// /// The name of the resource group. @@ -117,10 +138,15 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List VirtualNetworkGateways operation retrieves all the - /// virtual network gateways stored. + /// Gets all virtual network gateways by resource group. /// /// /// The name of the resource group. @@ -131,11 +157,19 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Reset VirtualNetworkGateway operation resets the primary of - /// the virtual network gateway in the specified resource group - /// through Network resource provider. + /// Resets the primary of the virtual network gateway in the specified + /// resource group. /// /// /// The name of the resource group. @@ -144,8 +178,8 @@ public partial interface IVirtualNetworkGatewaysOperations /// The name of the virtual network gateway. /// /// - /// Virtual network gateway vip address supplied to the Begin Reset of - /// Active-Active feature enabled Gateway. + /// Virtual network gateway vip address supplied to the begin reset of + /// the active-active feature enabled gateway. /// /// /// The headers that will be added to request. @@ -153,11 +187,19 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation token. /// - Task> ResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> ResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Reset VirtualNetworkGateway operation resets the primary of - /// the virtual network gateway in the specified resource group - /// through Network resource provider. + /// Resets the primary of the virtual network gateway in the specified + /// resource group. /// /// /// The name of the resource group. @@ -166,8 +208,8 @@ public partial interface IVirtualNetworkGatewaysOperations /// The name of the virtual network gateway. /// /// - /// Virtual network gateway vip address supplied to the Begin Reset of - /// Active-Active feature enabled Gateway. + /// Virtual network gateway vip address supplied to the begin reset of + /// the active-active feature enabled gateway. /// /// /// The headers that will be added to request. @@ -175,11 +217,19 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation token. /// - Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Generatevpnclientpackage operation generates Vpn client - /// package for P2S client of the virtual network gateway in the - /// specified resource group through Network resource provider. + /// Generates VPN client package for P2S client of the virtual network + /// gateway in the specified resource group. /// /// /// The name of the resource group. @@ -188,9 +238,8 @@ public partial interface IVirtualNetworkGatewaysOperations /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the Begin Generating Virtual Network - /// Gateway Vpn client package operation through Network resource - /// provider. + /// Parameters supplied to the generate virtual network gateway VPN + /// client package operation. /// /// /// The headers that will be added to request. @@ -198,10 +247,18 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation token. /// - Task> GeneratevpnclientpackageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GeneratevpnclientpackageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List VirtualNetworkGateways operation retrieves all the - /// virtual network gateways stored. + /// Gets all virtual network gateways by resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -212,6 +269,15 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation token. /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkPeeringsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkPeeringsOperations.cs index f6d7a975a8c9e..f9a184cbb52c6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkPeeringsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkPeeringsOperations.cs @@ -2,18 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -23,8 +17,7 @@ namespace Microsoft.Azure.Management.Network public partial interface IVirtualNetworkPeeringsOperations { /// - /// The delete virtual network peering operation deletes the specified - /// peering. + /// Deletes the specified virtual network peering. /// /// /// The name of the resource group. @@ -41,10 +34,15 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// The cancellation token. /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The delete virtual network peering operation deletes the specified - /// peering. + /// Deletes the specified virtual network peering. /// /// /// The name of the resource group. @@ -61,10 +59,15 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Get virtual network peering operation retrieves information - /// about the specified virtual network peering. + /// Gets the specified virtual network peering. /// /// /// The name of the resource group. @@ -81,10 +84,18 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put virtual network peering operation creates/updates a - /// peering in the specified virtual network + /// Creates or updates a peering in the specified virtual network. /// /// /// The name of the resource group. @@ -96,8 +107,8 @@ public partial interface IVirtualNetworkPeeringsOperations /// The name of the peering. /// /// - /// Parameters supplied to the create/update virtual network peering - /// operation + /// Parameters supplied to the create or update virtual network + /// peering operation. /// /// /// The headers that will be added to request. @@ -105,10 +116,18 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put virtual network peering operation creates/updates a - /// peering in the specified virtual network + /// Creates or updates a peering in the specified virtual network. /// /// /// The name of the resource group. @@ -120,8 +139,8 @@ public partial interface IVirtualNetworkPeeringsOperations /// The name of the peering. /// /// - /// Parameters supplied to the create/update virtual network peering - /// operation + /// Parameters supplied to the create or update virtual network + /// peering operation. /// /// /// The headers that will be added to request. @@ -129,10 +148,18 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List virtual network peerings operation retrieves all the - /// peerings in a virtual network. + /// Gets all virtual network peerings in a virtual network. /// /// /// The name of the resource group. @@ -146,10 +173,18 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The List virtual network peerings operation retrieves all the - /// peerings in a virtual network. + /// Gets all virtual network peerings in a virtual network. /// /// /// The NextLink from the previous successful call to List operation. @@ -160,6 +195,15 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// The cancellation token. /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworksOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworksOperations.cs index e6c91b341bc59..972fe2d1615ac 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworksOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworksOperations.cs @@ -2,18 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -23,8 +17,7 @@ namespace Microsoft.Azure.Management.Network public partial interface IVirtualNetworksOperations { /// - /// The Delete VirtualNetwork operation deletes the specified virtual - /// network + /// Deletes the specified virtual network. /// /// /// The name of the resource group. @@ -38,10 +31,15 @@ public partial interface IVirtualNetworksOperations /// /// The cancellation token. /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Delete VirtualNetwork operation deletes the specified virtual - /// network + /// Deletes the specified virtual network. /// /// /// The name of the resource group. @@ -55,10 +53,15 @@ public partial interface IVirtualNetworksOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Get VirtualNetwork operation retrieves information about the - /// specified virtual network. + /// Gets the specified virtual network by resource group. /// /// /// The name of the resource group. @@ -67,7 +70,7 @@ public partial interface IVirtualNetworksOperations /// The name of the virtual network. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// The headers that will be added to request. @@ -75,10 +78,19 @@ public partial interface IVirtualNetworksOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put VirtualNetwork operation creates/updates a virtual network - /// in the specified resource group. + /// Creates or updates a virtual network in the specified resource + /// group. /// /// /// The name of the resource group. @@ -87,7 +99,8 @@ public partial interface IVirtualNetworksOperations /// The name of the virtual network. /// /// - /// Parameters supplied to the create/update Virtual Network operation + /// Parameters supplied to the create or update virtual network + /// operation /// /// /// The headers that will be added to request. @@ -95,10 +108,19 @@ public partial interface IVirtualNetworksOperations /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The Put VirtualNetwork operation creates/updates a virtual network - /// in the specified resource group. + /// Creates or updates a virtual network in the specified resource + /// group. /// /// /// The name of the resource group. @@ -107,7 +129,8 @@ public partial interface IVirtualNetworksOperations /// The name of the virtual network. /// /// - /// Parameters supplied to the create/update Virtual Network operation + /// Parameters supplied to the create or update virtual network + /// operation /// /// /// The headers that will be added to request. @@ -115,10 +138,18 @@ public partial interface IVirtualNetworksOperations /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The list VirtualNetwork returns all Virtual Networks in a - /// subscription + /// Gets all virtual networks in a subscription. /// /// /// The headers that will be added to request. @@ -126,10 +157,18 @@ public partial interface IVirtualNetworksOperations /// /// The cancellation token. /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The list VirtualNetwork returns all Virtual Networks in a resource - /// group + /// Gets all virtual networks in a resource group. /// /// /// The name of the resource group. @@ -140,9 +179,18 @@ public partial interface IVirtualNetworksOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Checks whether a private Ip address is available for use. + /// Checks whether a private IP address is available for use. /// /// /// The name of the resource group. @@ -159,10 +207,18 @@ public partial interface IVirtualNetworksOperations /// /// The cancellation token. /// - Task> CheckIPAddressAvailabilityWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string ipAddress = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task> CheckIPAddressAvailabilityWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string ipAddress = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The list VirtualNetwork returns all Virtual Networks in a - /// subscription + /// Gets all virtual networks in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -173,10 +229,18 @@ public partial interface IVirtualNetworksOperations /// /// The cancellation token. /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// The list VirtualNetwork returns all Virtual Networks in a resource - /// group + /// Gets all virtual networks in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -187,6 +251,15 @@ public partial interface IVirtualNetworksOperations /// /// The cancellation token. /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperations.cs index c49e84e7c35bb..233adbc60aa12 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperations.cs @@ -2,32 +2,21 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; using System.Linq; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using Microsoft.Rest.Azure; using Models; /// /// LoadBalancersOperations operations. /// - internal partial class LoadBalancersOperations : IServiceOperations, ILoadBalancersOperations + internal partial class LoadBalancersOperations : Microsoft.Rest.IServiceOperations, ILoadBalancersOperations { /// /// Initializes a new instance of the LoadBalancersOperations class. @@ -35,11 +24,14 @@ internal partial class LoadBalancersOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal LoadBalancersOperations(NetworkManagementClient client) { if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } this.Client = client; } @@ -50,13 +42,13 @@ internal LoadBalancersOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The delete LoadBalancer operation deletes the specified load balancer. + /// Deletes the specified load balancer. /// /// /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// /// The headers that will be added to request. @@ -64,22 +56,22 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, loadBalancerName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete LoadBalancer operation deletes the specified load balancer. + /// Deletes the specified load balancer. /// /// /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// /// Headers that will be added to request. @@ -87,63 +79,69 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{loadBalancerName}", Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -176,30 +174,35 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -209,7 +212,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -218,23 +221,22 @@ internal LoadBalancersOperations(NetworkManagementClient client) } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Get LoadBalancer operation retrieves information about the specified - /// LoadBalancer. + /// Gets the specified load balancer. /// /// /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// Headers that will be added to request. @@ -242,68 +244,77 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{loadBalancerName}", Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (expand != null) { - _queryParameters.Add(string.Format("$expand={0}", Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -336,43 +347,43 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -382,7 +393,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -395,36 +406,36 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Put LoadBalancer operation creates/updates a LoadBalancer + /// Creates or updates a load balancer. /// /// /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// - /// Parameters supplied to the create/delete LoadBalancer operation + /// Parameters supplied to the create or update load balancer operation. /// /// /// The headers that will be added to request. @@ -432,10 +443,10 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, loadBalancerName, parameters, customHeaders, cancellationToken); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, @@ -443,16 +454,16 @@ internal LoadBalancersOperations(NetworkManagementClient client) } /// - /// The Put LoadBalancer operation creates/updates a LoadBalancer + /// Creates or updates a load balancer. /// /// /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// - /// Parameters supplied to the create/delete LoadBalancer operation + /// Parameters supplied to the create or update load balancer operation. /// /// /// Headers that will be added to request. @@ -460,68 +471,77 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (loadBalancerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); } if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{loadBalancerName}", Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -547,9 +567,9 @@ internal LoadBalancersOperations(NetworkManagementClient client) string _requestContent = null; if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) @@ -560,43 +580,43 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 201 && (int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -606,7 +626,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -619,16 +639,16 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -637,28 +657,27 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// subscription. + /// Gets all the load balancers in a subscription. /// /// /// Headers that will be added to request. @@ -666,51 +685,60 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -743,43 +771,43 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -789,7 +817,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -802,28 +830,27 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// resource group. + /// Gets all the load balancers in a resource group. /// /// /// The name of the resource group. @@ -834,57 +861,66 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -917,43 +953,43 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -963,7 +999,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -976,28 +1012,27 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// subscription. + /// Gets all the load balancers in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -1008,43 +1043,52 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1077,43 +1121,43 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1123,7 +1167,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1136,28 +1180,27 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// resource group. + /// Gets all the load balancers in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -1168,43 +1211,52 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1237,43 +1289,43 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1283,7 +1335,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1296,21 +1348,21 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperationsExtensions.cs index 9b8aa7b419fad..7b9cce404a305 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperationsExtensions.cs @@ -2,20 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; + using Microsoft.Rest.Azure; + using Models; /// /// Extension methods for LoadBalancersOperations. @@ -23,7 +18,7 @@ namespace Microsoft.Azure.Management.Network public static partial class LoadBalancersOperationsExtensions { /// - /// The delete LoadBalancer operation deletes the specified load balancer. + /// Deletes the specified load balancer. /// /// /// The operations group for this extension method. @@ -32,15 +27,15 @@ public static partial class LoadBalancersOperationsExtensions /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// public static void Delete(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName) { - Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).DeleteAsync(resourceGroupName, loadBalancerName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).DeleteAsync(resourceGroupName, loadBalancerName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete LoadBalancer operation deletes the specified load balancer. + /// Deletes the specified load balancer. /// /// /// The operations group for this extension method. @@ -49,18 +44,18 @@ public static void Delete(this ILoadBalancersOperations operations, string resou /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false); } /// - /// The delete LoadBalancer operation deletes the specified load balancer. + /// Deletes the specified load balancer. /// /// /// The operations group for this extension method. @@ -69,15 +64,15 @@ public static void Delete(this ILoadBalancersOperations operations, string resou /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// public static void BeginDelete(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName) { - Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).BeginDeleteAsync(resourceGroupName, loadBalancerName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).BeginDeleteAsync(resourceGroupName, loadBalancerName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete LoadBalancer operation deletes the specified load balancer. + /// Deletes the specified load balancer. /// /// /// The operations group for this extension method. @@ -86,19 +81,18 @@ public static void BeginDelete(this ILoadBalancersOperations operations, string /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Get LoadBalancer operation retrieves information about the specified - /// LoadBalancer. + /// Gets the specified load balancer. /// /// /// The operations group for this extension method. @@ -107,19 +101,18 @@ public static void BeginDelete(this ILoadBalancersOperations operations, string /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// - /// expand references resources. + /// Expands referenced resources. /// public static LoadBalancer Get(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, string expand = default(string)) { - return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).GetAsync(resourceGroupName, loadBalancerName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).GetAsync(resourceGroupName, loadBalancerName, expand), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get LoadBalancer operation retrieves information about the specified - /// LoadBalancer. + /// Gets the specified load balancer. /// /// /// The operations group for this extension method. @@ -128,15 +121,15 @@ public static void BeginDelete(this ILoadBalancersOperations operations, string /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// The cancellation token. /// - public static async Task GetAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, loadBalancerName, expand, null, cancellationToken).ConfigureAwait(false)) { @@ -145,7 +138,7 @@ public static void BeginDelete(this ILoadBalancersOperations operations, string } /// - /// The Put LoadBalancer operation creates/updates a LoadBalancer + /// Creates or updates a load balancer. /// /// /// The operations group for this extension method. @@ -154,18 +147,18 @@ public static void BeginDelete(this ILoadBalancersOperations operations, string /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// - /// Parameters supplied to the create/delete LoadBalancer operation + /// Parameters supplied to the create or update load balancer operation. /// public static LoadBalancer CreateOrUpdate(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters) { - return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).CreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).CreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put LoadBalancer operation creates/updates a LoadBalancer + /// Creates or updates a load balancer. /// /// /// The operations group for this extension method. @@ -174,15 +167,15 @@ public static LoadBalancer CreateOrUpdate(this ILoadBalancersOperations operatio /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// - /// Parameters supplied to the create/delete LoadBalancer operation + /// Parameters supplied to the create or update load balancer operation. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -191,7 +184,7 @@ public static LoadBalancer CreateOrUpdate(this ILoadBalancersOperations operatio } /// - /// The Put LoadBalancer operation creates/updates a LoadBalancer + /// Creates or updates a load balancer. /// /// /// The operations group for this extension method. @@ -200,18 +193,18 @@ public static LoadBalancer CreateOrUpdate(this ILoadBalancersOperations operatio /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// - /// Parameters supplied to the create/delete LoadBalancer operation + /// Parameters supplied to the create or update load balancer operation. /// public static LoadBalancer BeginCreateOrUpdate(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters) { - return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put LoadBalancer operation creates/updates a LoadBalancer + /// Creates or updates a load balancer. /// /// /// The operations group for this extension method. @@ -220,15 +213,15 @@ public static LoadBalancer BeginCreateOrUpdate(this ILoadBalancersOperations ope /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// - /// Parameters supplied to the create/delete LoadBalancer operation + /// Parameters supplied to the create or update load balancer operation. /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -237,20 +230,18 @@ public static LoadBalancer BeginCreateOrUpdate(this ILoadBalancersOperations ope } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// subscription. + /// Gets all the load balancers in a subscription. /// /// /// The operations group for this extension method. /// - public static IPage ListAll(this ILoadBalancersOperations operations) + public static Microsoft.Rest.Azure.IPage ListAll(this ILoadBalancersOperations operations) { - return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).ListAllAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// subscription. + /// Gets all the load balancers in a subscription. /// /// /// The operations group for this extension method. @@ -258,7 +249,7 @@ public static IPage ListAll(this ILoadBalancersOperations operatio /// /// The cancellation token. /// - public static async Task> ListAllAsync(this ILoadBalancersOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllAsync(this ILoadBalancersOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -267,8 +258,7 @@ public static IPage ListAll(this ILoadBalancersOperations operatio } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// resource group. + /// Gets all the load balancers in a resource group. /// /// /// The operations group for this extension method. @@ -276,14 +266,13 @@ public static IPage ListAll(this ILoadBalancersOperations operatio /// /// The name of the resource group. /// - public static IPage List(this ILoadBalancersOperations operations, string resourceGroupName) + public static Microsoft.Rest.Azure.IPage List(this ILoadBalancersOperations operations, string resourceGroupName) { - return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// resource group. + /// Gets all the load balancers in a resource group. /// /// /// The operations group for this extension method. @@ -294,7 +283,7 @@ public static IPage List(this ILoadBalancersOperations operations, /// /// The cancellation token. /// - public static async Task> ListAsync(this ILoadBalancersOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this ILoadBalancersOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { @@ -303,8 +292,7 @@ public static IPage List(this ILoadBalancersOperations operations, } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// subscription. + /// Gets all the load balancers in a subscription. /// /// /// The operations group for this extension method. @@ -312,14 +300,13 @@ public static IPage List(this ILoadBalancersOperations operations, /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListAllNext(this ILoadBalancersOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListAllNext(this ILoadBalancersOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).ListAllNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).ListAllNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// subscription. + /// Gets all the load balancers in a subscription. /// /// /// The operations group for this extension method. @@ -330,7 +317,7 @@ public static IPage ListAllNext(this ILoadBalancersOperations oper /// /// The cancellation token. /// - public static async Task> ListAllNextAsync(this ILoadBalancersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllNextAsync(this ILoadBalancersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -339,8 +326,7 @@ public static IPage ListAllNext(this ILoadBalancersOperations oper } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// resource group. + /// Gets all the load balancers in a resource group. /// /// /// The operations group for this extension method. @@ -348,14 +334,13 @@ public static IPage ListAllNext(this ILoadBalancersOperations oper /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this ILoadBalancersOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListNext(this ILoadBalancersOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// resource group. + /// Gets all the load balancers in a resource group. /// /// /// The operations group for this extension method. @@ -366,7 +351,7 @@ public static IPage ListNext(this ILoadBalancersOperations operati /// /// The cancellation token. /// - public static async Task> ListNextAsync(this ILoadBalancersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this ILoadBalancersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperations.cs index 9c4c125874c8a..b0b652cab72ae 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperations.cs @@ -2,32 +2,21 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; using System.Linq; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using Microsoft.Rest.Azure; using Models; /// /// LocalNetworkGatewaysOperations operations. /// - internal partial class LocalNetworkGatewaysOperations : IServiceOperations, ILocalNetworkGatewaysOperations + internal partial class LocalNetworkGatewaysOperations : Microsoft.Rest.IServiceOperations, ILocalNetworkGatewaysOperations { /// /// Initializes a new instance of the LocalNetworkGatewaysOperations class. @@ -35,11 +24,14 @@ internal partial class LocalNetworkGatewaysOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } this.Client = client; } @@ -50,8 +42,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The Put LocalNetworkGateway operation creates/updates a local network - /// gateway in the specified resource group through Network resource provider. + /// Creates or updates a local network gateway in the specified resource group. /// /// /// The name of the resource group. @@ -60,8 +51,8 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// The name of the local network gateway. /// /// - /// Parameters supplied to the Begin Create or update Local Network Gateway - /// operation through Network resource provider. + /// Parameters supplied to the create or update local network gateway + /// operation. /// /// /// The headers that will be added to request. @@ -69,10 +60,10 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, localNetworkGatewayName, parameters, customHeaders, cancellationToken); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, @@ -80,8 +71,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) } /// - /// The Put LocalNetworkGateway operation creates/updates a local network - /// gateway in the specified resource group through Network resource provider. + /// Creates or updates a local network gateway in the specified resource group. /// /// /// The name of the resource group. @@ -90,8 +80,8 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// The name of the local network gateway. /// /// - /// Parameters supplied to the Begin Create or update Local Network Gateway - /// operation through Network resource provider. + /// Parameters supplied to the create or update local network gateway + /// operation. /// /// /// Headers that will be added to request. @@ -99,22 +89,31 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (localNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "localNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "localNetworkGatewayName"); } if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } if (parameters != null) { @@ -122,49 +121,49 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{localNetworkGatewayName}", Uri.EscapeDataString(localNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{localNetworkGatewayName}", System.Uri.EscapeDataString(localNetworkGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -190,9 +189,9 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) string _requestContent = null; if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) @@ -203,43 +202,43 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 201 && (int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -249,7 +248,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -262,16 +261,16 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -280,28 +279,27 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Get LocalNetworkGateway operation retrieves information about the - /// specified local network gateway through Network resource provider. + /// Gets the specified local network gateway in a resource group. /// /// /// The name of the resource group. @@ -315,63 +313,72 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (localNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "localNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "localNetworkGatewayName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{localNetworkGatewayName}", Uri.EscapeDataString(localNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{localNetworkGatewayName}", System.Uri.EscapeDataString(localNetworkGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -404,43 +411,43 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -450,7 +457,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -463,28 +470,27 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Delete LocalNetworkGateway operation deletes the specified local - /// network Gateway through Network resource provider. + /// Deletes the specified local network gateway. /// /// /// The name of the resource group. @@ -498,17 +504,16 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, localNetworkGatewayName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The Delete LocalNetworkGateway operation deletes the specified local - /// network Gateway through Network resource provider. + /// Deletes the specified local network gateway. /// /// /// The name of the resource group. @@ -522,63 +527,69 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (localNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "localNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "localNetworkGatewayName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{localNetworkGatewayName}", Uri.EscapeDataString(localNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{localNetworkGatewayName}", System.Uri.EscapeDataString(localNetworkGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -611,30 +622,35 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 204 && (int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -644,7 +660,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -653,14 +669,13 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List LocalNetworkGateways operation retrieves all the local network - /// gateways stored. + /// Gets all the local network gateways in a resource group. /// /// /// The name of the resource group. @@ -671,57 +686,66 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -754,43 +778,43 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -800,7 +824,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -813,28 +837,27 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List LocalNetworkGateways operation retrieves all the local network - /// gateways stored. + /// Gets all the local network gateways in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -845,43 +868,52 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -914,43 +946,43 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -960,7 +992,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -973,21 +1005,21 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperationsExtensions.cs index 7e232e853e232..f78d11b3f32bf 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperationsExtensions.cs @@ -2,20 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; + using Microsoft.Rest.Azure; + using Models; /// /// Extension methods for LocalNetworkGatewaysOperations. @@ -23,8 +18,7 @@ namespace Microsoft.Azure.Management.Network public static partial class LocalNetworkGatewaysOperationsExtensions { /// - /// The Put LocalNetworkGateway operation creates/updates a local network - /// gateway in the specified resource group through Network resource provider. + /// Creates or updates a local network gateway in the specified resource group. /// /// /// The operations group for this extension method. @@ -36,17 +30,16 @@ public static partial class LocalNetworkGatewaysOperationsExtensions /// The name of the local network gateway. /// /// - /// Parameters supplied to the Begin Create or update Local Network Gateway - /// operation through Network resource provider. + /// Parameters supplied to the create or update local network gateway + /// operation. /// public static LocalNetworkGateway CreateOrUpdate(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters) { - return Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).CreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).CreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put LocalNetworkGateway operation creates/updates a local network - /// gateway in the specified resource group through Network resource provider. + /// Creates or updates a local network gateway in the specified resource group. /// /// /// The operations group for this extension method. @@ -58,13 +51,13 @@ public static LocalNetworkGateway CreateOrUpdate(this ILocalNetworkGatewaysOpera /// The name of the local network gateway. /// /// - /// Parameters supplied to the Begin Create or update Local Network Gateway - /// operation through Network resource provider. + /// Parameters supplied to the create or update local network gateway + /// operation. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -73,8 +66,7 @@ public static LocalNetworkGateway CreateOrUpdate(this ILocalNetworkGatewaysOpera } /// - /// The Put LocalNetworkGateway operation creates/updates a local network - /// gateway in the specified resource group through Network resource provider. + /// Creates or updates a local network gateway in the specified resource group. /// /// /// The operations group for this extension method. @@ -86,17 +78,16 @@ public static LocalNetworkGateway CreateOrUpdate(this ILocalNetworkGatewaysOpera /// The name of the local network gateway. /// /// - /// Parameters supplied to the Begin Create or update Local Network Gateway - /// operation through Network resource provider. + /// Parameters supplied to the create or update local network gateway + /// operation. /// public static LocalNetworkGateway BeginCreateOrUpdate(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters) { - return Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put LocalNetworkGateway operation creates/updates a local network - /// gateway in the specified resource group through Network resource provider. + /// Creates or updates a local network gateway in the specified resource group. /// /// /// The operations group for this extension method. @@ -108,13 +99,13 @@ public static LocalNetworkGateway BeginCreateOrUpdate(this ILocalNetworkGateways /// The name of the local network gateway. /// /// - /// Parameters supplied to the Begin Create or update Local Network Gateway - /// operation through Network resource provider. + /// Parameters supplied to the create or update local network gateway + /// operation. /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -123,8 +114,7 @@ public static LocalNetworkGateway BeginCreateOrUpdate(this ILocalNetworkGateways } /// - /// The Get LocalNetworkGateway operation retrieves information about the - /// specified local network gateway through Network resource provider. + /// Gets the specified local network gateway in a resource group. /// /// /// The operations group for this extension method. @@ -137,12 +127,11 @@ public static LocalNetworkGateway BeginCreateOrUpdate(this ILocalNetworkGateways /// public static LocalNetworkGateway Get(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) { - return Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).GetAsync(resourceGroupName, localNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).GetAsync(resourceGroupName, localNetworkGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get LocalNetworkGateway operation retrieves information about the - /// specified local network gateway through Network resource provider. + /// Gets the specified local network gateway in a resource group. /// /// /// The operations group for this extension method. @@ -156,7 +145,7 @@ public static LocalNetworkGateway Get(this ILocalNetworkGatewaysOperations opera /// /// The cancellation token. /// - public static async Task GetAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) { @@ -165,8 +154,7 @@ public static LocalNetworkGateway Get(this ILocalNetworkGatewaysOperations opera } /// - /// The Delete LocalNetworkGateway operation deletes the specified local - /// network Gateway through Network resource provider. + /// Deletes the specified local network gateway. /// /// /// The operations group for this extension method. @@ -179,12 +167,11 @@ public static LocalNetworkGateway Get(this ILocalNetworkGatewaysOperations opera /// public static void Delete(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) { - Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).DeleteAsync(resourceGroupName, localNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).DeleteAsync(resourceGroupName, localNetworkGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete LocalNetworkGateway operation deletes the specified local - /// network Gateway through Network resource provider. + /// Deletes the specified local network gateway. /// /// /// The operations group for this extension method. @@ -198,14 +185,13 @@ public static void Delete(this ILocalNetworkGatewaysOperations operations, strin /// /// The cancellation token. /// - public static async Task DeleteAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Delete LocalNetworkGateway operation deletes the specified local - /// network Gateway through Network resource provider. + /// Deletes the specified local network gateway. /// /// /// The operations group for this extension method. @@ -218,12 +204,11 @@ public static void Delete(this ILocalNetworkGatewaysOperations operations, strin /// public static void BeginDelete(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) { - Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).BeginDeleteAsync(resourceGroupName, localNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).BeginDeleteAsync(resourceGroupName, localNetworkGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete LocalNetworkGateway operation deletes the specified local - /// network Gateway through Network resource provider. + /// Deletes the specified local network gateway. /// /// /// The operations group for this extension method. @@ -237,14 +222,13 @@ public static void BeginDelete(this ILocalNetworkGatewaysOperations operations, /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// The List LocalNetworkGateways operation retrieves all the local network - /// gateways stored. + /// Gets all the local network gateways in a resource group. /// /// /// The operations group for this extension method. @@ -252,14 +236,13 @@ public static void BeginDelete(this ILocalNetworkGatewaysOperations operations, /// /// The name of the resource group. /// - public static IPage List(this ILocalNetworkGatewaysOperations operations, string resourceGroupName) + public static Microsoft.Rest.Azure.IPage List(this ILocalNetworkGatewaysOperations operations, string resourceGroupName) { - return Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List LocalNetworkGateways operation retrieves all the local network - /// gateways stored. + /// Gets all the local network gateways in a resource group. /// /// /// The operations group for this extension method. @@ -270,7 +253,7 @@ public static IPage List(this ILocalNetworkGatewaysOperatio /// /// The cancellation token. /// - public static async Task> ListAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { @@ -279,8 +262,7 @@ public static IPage List(this ILocalNetworkGatewaysOperatio } /// - /// The List LocalNetworkGateways operation retrieves all the local network - /// gateways stored. + /// Gets all the local network gateways in a resource group. /// /// /// The operations group for this extension method. @@ -288,14 +270,13 @@ public static IPage List(this ILocalNetworkGatewaysOperatio /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this ILocalNetworkGatewaysOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListNext(this ILocalNetworkGatewaysOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List LocalNetworkGateways operation retrieves all the local network - /// gateways stored. + /// Gets all the local network gateways in a resource group. /// /// /// The operations group for this extension method. @@ -306,7 +287,7 @@ public static IPage ListNext(this ILocalNetworkGatewaysOper /// /// The cancellation token. /// - public static async Task> ListNextAsync(this ILocalNetworkGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this ILocalNetworkGatewaysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AddressSpace.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AddressSpace.cs index 606d9f1380bd3..1ea669916b8fc 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AddressSpace.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AddressSpace.cs @@ -2,23 +2,17 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// /// AddressSpace contains an array of IP address ranges that can be used - /// by subnets + /// by subnets of the virtual network. /// public partial class AddressSpace { @@ -30,17 +24,19 @@ public AddressSpace() { } /// /// Initializes a new instance of the AddressSpace class. /// - public AddressSpace(IList addressPrefixes = default(IList)) + /// A list of address blocks reserved + /// for this virtual network in CIDR notation. + public AddressSpace(System.Collections.Generic.IList addressPrefixes = default(System.Collections.Generic.IList)) { AddressPrefixes = addressPrefixes; } /// - /// Gets or sets list of address blocks reserved for this virtual - /// network in CIDR notation + /// Gets or sets a list of address blocks reserved for this virtual + /// network in CIDR notation. /// - [JsonProperty(PropertyName = "addressPrefixes")] - public IList AddressPrefixes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefixes")] + public System.Collections.Generic.IList AddressPrefixes { get; set; } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGateway.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGateway.cs index 9b335b2a368d8..15e11956df6c6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGateway.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGateway.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// ApplicationGateways resource + /// Application gateway resource /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGateway : Resource { /// @@ -30,15 +24,58 @@ public ApplicationGateway() { } /// /// Initializes a new instance of the ApplicationGateway class. /// - public ApplicationGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ApplicationGatewaySku sku = default(ApplicationGatewaySku), ApplicationGatewaySslPolicy sslPolicy = default(ApplicationGatewaySslPolicy), string operationalState = default(string), IList gatewayIPConfigurations = default(IList), IList authenticationCertificates = default(IList), IList sslCertificates = default(IList), IList frontendIPConfigurations = default(IList), IList frontendPorts = default(IList), IList probes = default(IList), IList backendAddressPools = default(IList), IList backendHttpSettingsCollection = default(IList), IList httpListeners = default(IList), IList urlPathMaps = default(IList), IList requestRoutingRules = default(IList), ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration = default(ApplicationGatewayWebApplicationFirewallConfiguration), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// SKU of the application gateway resource. + /// SSL policy of the application gateway + /// resource. + /// Operational state of the + /// application gateway resource. Possible values are: 'Stopped', + /// 'Started', 'Running', and 'Stopping'. Possible values include: + /// 'Stopped', 'Starting', 'Running', 'Stopping' + /// Subnets of application the + /// gateway resource. + /// Authentication + /// certificates of the application gateway resource. + /// SSL certificates of the application + /// gateway resource. + /// Frontend IP addresses of + /// the application gateway resource. + /// Frontend ports of the application + /// gateway resource. + /// Probes of the application gateway + /// resource. + /// Backend address pool of the + /// application gateway resource. + /// Backend http settings + /// of the application gateway resource. + /// Http listeners of the application + /// gateway resource. + /// URL path map of the application gateway + /// resource. + /// Request routing rules of the + /// application gateway resource. + /// Web application + /// firewall configuration. + /// Resource GUID property of the + /// application gateway resource. + /// Provisioning state of the + /// application gateway resource. Possible values are: 'Updating', + /// 'Deleting', and 'Failed'. + /// A unique read-only string that changes whenever + /// the resource is updated. + public ApplicationGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ApplicationGatewaySku sku = default(ApplicationGatewaySku), ApplicationGatewaySslPolicy sSLPolicy = default(ApplicationGatewaySslPolicy), string operationalState = default(string), System.Collections.Generic.IList gatewayIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList authenticationCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList sSLCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList frontendIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList frontendPorts = default(System.Collections.Generic.IList), System.Collections.Generic.IList probes = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendHttpSettingsCollection = default(System.Collections.Generic.IList), System.Collections.Generic.IList httpListeners = default(System.Collections.Generic.IList), System.Collections.Generic.IList urlPathMaps = default(System.Collections.Generic.IList), System.Collections.Generic.IList requestRoutingRules = default(System.Collections.Generic.IList), ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration = default(ApplicationGatewayWebApplicationFirewallConfiguration), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { Sku = sku; - SslPolicy = sslPolicy; + SSLPolicy = sSLPolicy; OperationalState = operationalState; GatewayIPConfigurations = gatewayIPConfigurations; AuthenticationCertificates = authenticationCertificates; - SslCertificates = sslCertificates; + SSLCertificates = sSLCertificates; FrontendIPConfigurations = frontendIPConfigurations; FrontendPorts = frontendPorts; Probes = probes; @@ -54,119 +91,131 @@ public ApplicationGateway() { } } /// - /// Sku of application gateway resource + /// Gets or sets SKU of the application gateway resource. /// - [JsonProperty(PropertyName = "properties.sku")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sku")] public ApplicationGatewaySku Sku { get; set; } /// - /// SSL policy of application gateway resource + /// Gets or sets SSL policy of the application gateway resource. /// - [JsonProperty(PropertyName = "properties.sslPolicy")] - public ApplicationGatewaySslPolicy SslPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.SSLPolicy")] + public ApplicationGatewaySslPolicy SSLPolicy { get; set; } /// - /// Operational state of application gateway resource. Possible values - /// include: 'Stopped', 'Starting', 'Running', 'Stopping' + /// Gets operational state of the application gateway resource. + /// Possible values are: 'Stopped', 'Started', 'Running', and + /// 'Stopping'. Possible values include: 'Stopped', 'Starting', + /// 'Running', 'Stopping' /// - [JsonProperty(PropertyName = "properties.operationalState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.operationalState")] public string OperationalState { get; private set; } /// - /// Subnets of application gateway resource + /// Gets or sets subnets of application the gateway resource. /// - [JsonProperty(PropertyName = "properties.gatewayIPConfigurations")] - public IList GatewayIPConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayIPConfigurations")] + public System.Collections.Generic.IList GatewayIPConfigurations { get; set; } /// - /// Authentication certificates of application gateway resource + /// Gets or sets authentication certificates of the application + /// gateway resource. /// - [JsonProperty(PropertyName = "properties.authenticationCertificates")] - public IList AuthenticationCertificates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authenticationCertificates")] + public System.Collections.Generic.IList AuthenticationCertificates { get; set; } /// - /// SSL certificates of application gateway resource + /// Gets or sets SSL certificates of the application gateway resource. /// - [JsonProperty(PropertyName = "properties.sslCertificates")] - public IList SslCertificates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.SSLCertificates")] + public System.Collections.Generic.IList SSLCertificates { get; set; } /// - /// Frontend IP addresses of application gateway resource + /// Gets or sets frontend IP addresses of the application gateway + /// resource. /// - [JsonProperty(PropertyName = "properties.frontendIPConfigurations")] - public IList FrontendIPConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfigurations")] + public System.Collections.Generic.IList FrontendIPConfigurations { get; set; } /// - /// Frontend ports of application gateway resource + /// Gets or sets frontend ports of the application gateway resource. /// - [JsonProperty(PropertyName = "properties.frontendPorts")] - public IList FrontendPorts { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPorts")] + public System.Collections.Generic.IList FrontendPorts { get; set; } /// - /// Probes of application gateway resource + /// Gets or sets probes of the application gateway resource. /// - [JsonProperty(PropertyName = "properties.probes")] - public IList Probes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.probes")] + public System.Collections.Generic.IList Probes { get; set; } /// - /// Backend address pool of application gateway resource + /// Gets or sets backend address pool of the application gateway + /// resource. /// - [JsonProperty(PropertyName = "properties.backendAddressPools")] - public IList BackendAddressPools { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPools")] + public System.Collections.Generic.IList BackendAddressPools { get; set; } /// - /// Backend http settings of application gateway resource + /// Gets or sets backend http settings of the application gateway + /// resource. /// - [JsonProperty(PropertyName = "properties.backendHttpSettingsCollection")] - public IList BackendHttpSettingsCollection { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendHttpSettingsCollection")] + public System.Collections.Generic.IList BackendHttpSettingsCollection { get; set; } /// - /// HTTP listeners of application gateway resource + /// Gets or sets http listeners of the application gateway resource. /// - [JsonProperty(PropertyName = "properties.httpListeners")] - public IList HttpListeners { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.httpListeners")] + public System.Collections.Generic.IList HttpListeners { get; set; } /// - /// URL path map of application gateway resource + /// Gets or sets URL path map of the application gateway resource. /// - [JsonProperty(PropertyName = "properties.urlPathMaps")] - public IList UrlPathMaps { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.urlPathMaps")] + public System.Collections.Generic.IList UrlPathMaps { get; set; } /// - /// Request routing rules of application gateway resource + /// Gets or sets request routing rules of the application gateway + /// resource. /// - [JsonProperty(PropertyName = "properties.requestRoutingRules")] - public IList RequestRoutingRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.requestRoutingRules")] + public System.Collections.Generic.IList RequestRoutingRules { get; set; } /// - /// Web application firewall configuration + /// Gets or sets web application firewall configuration. /// - [JsonProperty(PropertyName = "properties.webApplicationFirewallConfiguration")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.webApplicationFirewallConfiguration")] public ApplicationGatewayWebApplicationFirewallConfiguration WebApplicationFirewallConfiguration { get; set; } /// - /// Resource guid property of the ApplicationGateway resource + /// Gets or sets resource GUID property of the application gateway + /// resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// - /// Provisioning state of the ApplicationGateway resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the application gateway + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (this.WebApplicationFirewallConfiguration != null) diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayAuthenticationCertificate.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayAuthenticationCertificate.cs index ad041f416ed6e..6f075ae501310 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayAuthenticationCertificate.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayAuthenticationCertificate.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Authentication certificates of application gateway + /// Authentication certificates of an application gateway. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayAuthenticationCertificate : SubResource { /// @@ -32,6 +26,16 @@ public ApplicationGatewayAuthenticationCertificate() { } /// Initializes a new instance of the /// ApplicationGatewayAuthenticationCertificate class. /// + /// Resource ID. + /// Certificate public data. + /// Provisioning state of the + /// authentication certificate resource. Possible values are: + /// 'Updating', 'Deleting', and 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ApplicationGatewayAuthenticationCertificate(string id = default(string), string data = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -42,30 +46,31 @@ public ApplicationGatewayAuthenticationCertificate() { } } /// - /// Certificate public data + /// Gets or sets certificate public data. /// - [JsonProperty(PropertyName = "properties.data")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.data")] public string Data { get; set; } /// - /// Provisioning state of the authentication certificate resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the authentication certificate + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddress.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddress.cs index 8862d7930f223..105689b3c5d3e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddress.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddress.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Backend Address of application gateway + /// Backend address of an application gateway. /// public partial class ApplicationGatewayBackendAddress { @@ -31,6 +25,8 @@ public ApplicationGatewayBackendAddress() { } /// Initializes a new instance of the ApplicationGatewayBackendAddress /// class. /// + /// Fully qualified domain name (FQDN). + /// IP address public ApplicationGatewayBackendAddress(string fqdn = default(string), string ipAddress = default(string)) { Fqdn = fqdn; @@ -38,15 +34,15 @@ public ApplicationGatewayBackendAddress() { } } /// - /// Dns name + /// Gets or sets fully qualified domain name (FQDN). /// - [JsonProperty(PropertyName = "fqdn")] + [Newtonsoft.Json.JsonProperty(PropertyName = "fqdn")] public string Fqdn { get; set; } /// - /// Ip address + /// Gets or sets IP address /// - [JsonProperty(PropertyName = "ipAddress")] + [Newtonsoft.Json.JsonProperty(PropertyName = "ipAddress")] public string IpAddress { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddressPool.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddressPool.cs index 8162dd7f4cca1..e50e84d1972dc 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddressPool.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddressPool.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Backend Address Pool of application gateway + /// Backend Address Pool of an application gateway. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayBackendAddressPool : SubResource { /// @@ -32,7 +26,18 @@ public ApplicationGatewayBackendAddressPool() { } /// Initializes a new instance of the /// ApplicationGatewayBackendAddressPool class. /// - public ApplicationGatewayBackendAddressPool(string id = default(string), IList backendIPConfigurations = default(IList), IList backendAddresses = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) + /// Resource ID. + /// Collection of references to + /// IPs defined in network interfaces. + /// Backend addresses + /// Provisioning state of the backend + /// address pool resource. Possible values are: 'Updating', + /// 'Deleting', and 'Failed'. + /// Resource that is unique within a resource + /// group. This name can be used to access the resource. + /// A unique read-only string that changes whenever + /// the resource is updated. + public ApplicationGatewayBackendAddressPool(string id = default(string), System.Collections.Generic.IList backendIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendAddresses = default(System.Collections.Generic.IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { BackendIPConfigurations = backendIPConfigurations; @@ -43,36 +48,38 @@ public ApplicationGatewayBackendAddressPool() { } } /// - /// Collection of references to IPs defined in NICs + /// Gets or sets collection of references to IPs defined in network + /// interfaces. /// - [JsonProperty(PropertyName = "properties.backendIPConfigurations")] - public IList BackendIPConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendIPConfigurations")] + public System.Collections.Generic.IList BackendIPConfigurations { get; set; } /// - /// Backend addresses + /// Gets or sets backend addresses /// - [JsonProperty(PropertyName = "properties.backendAddresses")] - public IList BackendAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddresses")] + public System.Collections.Generic.IList BackendAddresses { get; set; } /// - /// Provisioning state of the backend address pool resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the backend address pool + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Resource that is unique within a resource group. This name can be - /// used to access the resource + /// Gets or sets resource that is unique within a resource group. This + /// name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealth.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealth.cs index 3527f5dcd51c3..05ec24cc529bf 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealth.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealth.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// List of backendhealth pools. + /// List of ApplicationGatewayBackendHealthPool resources. /// public partial class ApplicationGatewayBackendHealth { @@ -31,15 +25,15 @@ public ApplicationGatewayBackendHealth() { } /// Initializes a new instance of the ApplicationGatewayBackendHealth /// class. /// - public ApplicationGatewayBackendHealth(IList backendAddressPools = default(IList)) + public ApplicationGatewayBackendHealth(System.Collections.Generic.IList backendAddressPools = default(System.Collections.Generic.IList)) { BackendAddressPools = backendAddressPools; } /// /// - [JsonProperty(PropertyName = "backendAddressPools")] - public IList BackendAddressPools { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "backendAddressPools")] + public System.Collections.Generic.IList BackendAddressPools { get; set; } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs index b799a7fa02b63..87ef7c2faa47c 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Application gateway backendhealth http settings. + /// Application gateway BackendHealthHttp settings. /// public partial class ApplicationGatewayBackendHealthHttpSettings { @@ -31,23 +25,29 @@ public ApplicationGatewayBackendHealthHttpSettings() { } /// Initializes a new instance of the /// ApplicationGatewayBackendHealthHttpSettings class. /// - public ApplicationGatewayBackendHealthHttpSettings(ApplicationGatewayBackendHttpSettings backendHttpSettings = default(ApplicationGatewayBackendHttpSettings), IList servers = default(IList)) + /// Reference of an + /// ApplicationGatewayBackendHttpSettings resource. + /// List of + /// ApplicationGatewayBackendHealthServer resources. + public ApplicationGatewayBackendHealthHttpSettings(ApplicationGatewayBackendHttpSettings backendHttpSettings = default(ApplicationGatewayBackendHttpSettings), System.Collections.Generic.IList servers = default(System.Collections.Generic.IList)) { BackendHttpSettings = backendHttpSettings; Servers = servers; } /// - /// Reference of application gateway backend http settings resource. + /// Gets or sets reference of an ApplicationGatewayBackendHttpSettings + /// resource. /// - [JsonProperty(PropertyName = "backendHttpSettings")] + [Newtonsoft.Json.JsonProperty(PropertyName = "backendHttpSettings")] public ApplicationGatewayBackendHttpSettings BackendHttpSettings { get; set; } /// - /// List of application gateway backendhealth servers. + /// Gets or sets list of ApplicationGatewayBackendHealthServer + /// resources. /// - [JsonProperty(PropertyName = "servers")] - public IList Servers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "servers")] + public System.Collections.Generic.IList Servers { get; set; } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthPool.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthPool.cs index e7c1cbb85f88b..df82eed1fe808 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthPool.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthPool.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Application gateway backendhealth pool. + /// Application gateway BackendHealth pool. /// public partial class ApplicationGatewayBackendHealthPool { @@ -31,23 +25,29 @@ public ApplicationGatewayBackendHealthPool() { } /// Initializes a new instance of the /// ApplicationGatewayBackendHealthPool class. /// - public ApplicationGatewayBackendHealthPool(ApplicationGatewayBackendAddressPool backendAddressPool = default(ApplicationGatewayBackendAddressPool), IList backendHttpSettingsCollection = default(IList)) + /// Reference of an + /// ApplicationGatewayBackendAddressPool resource. + /// List of + /// ApplicationGatewayBackendHealthHttpSettings resources. + public ApplicationGatewayBackendHealthPool(ApplicationGatewayBackendAddressPool backendAddressPool = default(ApplicationGatewayBackendAddressPool), System.Collections.Generic.IList backendHttpSettingsCollection = default(System.Collections.Generic.IList)) { BackendAddressPool = backendAddressPool; BackendHttpSettingsCollection = backendHttpSettingsCollection; } /// - /// Reference of application gateway backend address pool resource. + /// Gets or sets reference of an ApplicationGatewayBackendAddressPool + /// resource. /// - [JsonProperty(PropertyName = "backendAddressPool")] + [Newtonsoft.Json.JsonProperty(PropertyName = "backendAddressPool")] public ApplicationGatewayBackendAddressPool BackendAddressPool { get; set; } /// - /// List of application gateway backendhealth http settings. + /// Gets or sets list of ApplicationGatewayBackendHealthHttpSettings + /// resources. /// - [JsonProperty(PropertyName = "backendHttpSettingsCollection")] - public IList BackendHttpSettingsCollection { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "backendHttpSettingsCollection")] + public System.Collections.Generic.IList BackendHttpSettingsCollection { get; set; } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServer.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServer.cs index 1fd307af0e876..0254d71f1df24 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServer.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServer.cs @@ -2,19 +2,13 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// /// Application gateway backendhealth http settings. @@ -31,6 +25,12 @@ public ApplicationGatewayBackendHealthServer() { } /// Initializes a new instance of the /// ApplicationGatewayBackendHealthServer class. /// + /// IP address or FQDN of backend server. + /// Reference of IP configuration of + /// backend server. + /// Health of backend server. Possible values + /// are: 'Unknown', 'Up', 'Down', and 'Partial'. Possible values + /// include: 'Unknown', 'Up', 'Down', 'Partial' public ApplicationGatewayBackendHealthServer(string address = default(string), SubResource ipConfiguration = default(SubResource), string health = default(string)) { Address = address; @@ -39,22 +39,23 @@ public ApplicationGatewayBackendHealthServer() { } } /// - /// IP address or FQDN of backend server + /// Gets or sets IP address or FQDN of backend server. /// - [JsonProperty(PropertyName = "address")] + [Newtonsoft.Json.JsonProperty(PropertyName = "address")] public string Address { get; set; } /// - /// Reference of IP configuration of backend server. + /// Gets or sets reference of IP configuration of backend server. /// - [JsonProperty(PropertyName = "ipConfiguration")] + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfiguration")] public SubResource IpConfiguration { get; set; } /// - /// Health of backend server. Possible values include: 'Unknown', - /// 'Healthy', 'Unhealthy', 'Partial' + /// Gets or sets health of backend server. Possible values are: + /// 'Unknown', 'Up', 'Down', and 'Partial'. Possible values include: + /// 'Unknown', 'Up', 'Down', 'Partial' /// - [JsonProperty(PropertyName = "health")] + [Newtonsoft.Json.JsonProperty(PropertyName = "health")] public string Health { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServerHealth.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServerHealth.cs index c63948d3c3f29..ed002f0942302 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServerHealth.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServerHealth.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for ApplicationGatewayBackendHealthServerHealth. @@ -18,8 +15,8 @@ namespace Microsoft.Azure.Management.Network.Models public static class ApplicationGatewayBackendHealthServerHealth { public const string Unknown = "Unknown"; - public const string Healthy = "Healthy"; - public const string Unhealthy = "Unhealthy"; + public const string Up = "Up"; + public const string Down = "Down"; public const string Partial = "Partial"; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHttpSettings.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHttpSettings.cs index 63584a836aa98..44d43ec067fa1 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHttpSettings.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHttpSettings.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Backend address pool settings of application gateway + /// Backend address pool settings of an application gateway. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayBackendHttpSettings : SubResource { /// @@ -32,7 +26,30 @@ public ApplicationGatewayBackendHttpSettings() { } /// Initializes a new instance of the /// ApplicationGatewayBackendHttpSettings class. /// - public ApplicationGatewayBackendHttpSettings(string id = default(string), int? port = default(int?), string protocol = default(string), string cookieBasedAffinity = default(string), int? requestTimeout = default(int?), SubResource probe = default(SubResource), IList authenticationCertificates = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) + /// Resource ID. + /// Port + /// Protocol. Possible values are: 'Http' and + /// 'Https'. Possible values include: 'Http', 'Https' + /// Cookie based affinity. Possible + /// values are: 'Enabled' and 'Disabled'. Possible values include: + /// 'Enabled', 'Disabled' + /// Request timeout in seconds. + /// Application Gateway will fail the request if response is not + /// received within RequestTimeout. Acceptable values are from 1 + /// second to 86400 seconds. + /// Probe resource of an application + /// gateway. + /// Array of references to + /// application gateway authentication certificates. + /// Provisioning state of the backend + /// http settings resource. Possible values are: 'Updating', + /// 'Deleting', and 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. + public ApplicationGatewayBackendHttpSettings(string id = default(string), int? port = default(int?), string protocol = default(string), string cookieBasedAffinity = default(string), int? requestTimeout = default(int?), SubResource probe = default(SubResource), System.Collections.Generic.IList authenticationCertificates = default(System.Collections.Generic.IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { Port = port; @@ -47,61 +64,67 @@ public ApplicationGatewayBackendHttpSettings() { } } /// - /// Port + /// Gets or sets port /// - [JsonProperty(PropertyName = "properties.port")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.port")] public int? Port { get; set; } /// - /// Protocol. Possible values include: 'Http', 'Https' + /// Gets or sets protocol. Possible values are: 'Http' and 'Https'. + /// Possible values include: 'Http', 'Https' /// - [JsonProperty(PropertyName = "properties.protocol")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// - /// Cookie affinity. Possible values include: 'Enabled', 'Disabled' + /// Gets or sets cookie based affinity. Possible values are: 'Enabled' + /// and 'Disabled'. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "properties.cookieBasedAffinity")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.cookieBasedAffinity")] public string CookieBasedAffinity { get; set; } /// - /// Request timeout + /// Gets or sets request timeout in seconds. Application Gateway will + /// fail the request if response is not received within + /// RequestTimeout. Acceptable values are from 1 second to 86400 + /// seconds. /// - [JsonProperty(PropertyName = "properties.requestTimeout")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.requestTimeout")] public int? RequestTimeout { get; set; } /// - /// Probe resource of application gateway + /// Gets or sets probe resource of an application gateway. /// - [JsonProperty(PropertyName = "properties.probe")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.probe")] public SubResource Probe { get; set; } /// - /// Array of references to Application Gateway Authentication - /// Certificates + /// Gets or sets array of references to application gateway + /// authentication certificates. /// - [JsonProperty(PropertyName = "properties.authenticationCertificates")] - public IList AuthenticationCertificates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authenticationCertificates")] + public System.Collections.Generic.IList AuthenticationCertificates { get; set; } /// - /// Provisioning state of the backend http settings resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the backend http settings + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayCookieBasedAffinity.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayCookieBasedAffinity.cs index bb5019fb19f80..7bd1177ddf164 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayCookieBasedAffinity.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayCookieBasedAffinity.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for ApplicationGatewayCookieBasedAffinity. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFirewallMode.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFirewallMode.cs index d971faa75cf58..de6759e58462a 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFirewallMode.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFirewallMode.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for ApplicationGatewayFirewallMode. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs index a2895e6d93804..78b81d9bb770f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Frontend IP configuration of application gateway + /// Frontend IP configuration of an application gateway. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayFrontendIPConfiguration : SubResource { /// @@ -32,6 +26,23 @@ public ApplicationGatewayFrontendIPConfiguration() { } /// Initializes a new instance of the /// ApplicationGatewayFrontendIPConfiguration class. /// + /// Resource ID. + /// PrivateIPAddress of the network + /// interface IP Configuration. + /// PrivateIP allocation + /// method. Possible values are: 'Static' and 'Dynamic'. Possible + /// values include: 'Static', 'Dynamic' + /// Reference of the subnet resource. + /// Reference of the PublicIP + /// resource. + /// Provisioning state of the public + /// IP resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ApplicationGatewayFrontendIPConfiguration(string id = default(string), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), SubResource subnet = default(SubResource), SubResource publicIPAddress = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -45,49 +56,51 @@ public ApplicationGatewayFrontendIPConfiguration() { } } /// - /// PrivateIPAddress of the Network Interface IP Configuration + /// Gets or sets privateIPAddress of the network interface IP + /// Configuration. /// - [JsonProperty(PropertyName = "properties.privateIPAddress")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddress")] public string PrivateIPAddress { get; set; } /// - /// PrivateIP allocation method (Static/Dynamic). Possible values - /// include: 'Static', 'Dynamic' + /// Gets or sets privateIP allocation method. Possible values are: + /// 'Static' and 'Dynamic'. Possible values include: 'Static', + /// 'Dynamic' /// - [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] public string PrivateIPAllocationMethod { get; set; } /// - /// Reference of the subnet resource + /// Gets or sets reference of the subnet resource. /// - [JsonProperty(PropertyName = "properties.subnet")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] public SubResource Subnet { get; set; } /// - /// Reference of the PublicIP resource + /// Gets or sets reference of the PublicIP resource. /// - [JsonProperty(PropertyName = "properties.publicIPAddress")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddress")] public SubResource PublicIPAddress { get; set; } /// - /// Provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the public IP resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendPort.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendPort.cs index 2aa96c971f1e8..0d7021278738e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendPort.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendPort.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Frontend Port of application gateway + /// Frontend port of an application gateway. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayFrontendPort : SubResource { /// @@ -32,6 +26,16 @@ public ApplicationGatewayFrontendPort() { } /// Initializes a new instance of the ApplicationGatewayFrontendPort /// class. /// + /// Resource ID. + /// Frontend port + /// Provisioning state of the frontend + /// port resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ApplicationGatewayFrontendPort(string id = default(string), int? port = default(int?), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -42,30 +46,30 @@ public ApplicationGatewayFrontendPort() { } } /// - /// Frontend port + /// Gets or sets frontend port /// - [JsonProperty(PropertyName = "properties.port")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.port")] public int? Port { get; set; } /// - /// Provisioning state of the frontend port resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the frontend port resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayHttpListener.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayHttpListener.cs index ade40fdc474d4..6d10a88d58b50 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayHttpListener.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayHttpListener.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Http listener of application gateway + /// Http listener of an application gateway. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayHttpListener : SubResource { /// @@ -32,14 +26,34 @@ public ApplicationGatewayHttpListener() { } /// Initializes a new instance of the ApplicationGatewayHttpListener /// class. /// - public ApplicationGatewayHttpListener(string id = default(string), SubResource frontendIPConfiguration = default(SubResource), SubResource frontendPort = default(SubResource), string protocol = default(string), string hostName = default(string), SubResource sslCertificate = default(SubResource), bool? requireServerNameIndication = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string)) + /// Resource ID. + /// Frontend IP configuration + /// resource of an application gateway. + /// Frontend port resource of an + /// application gateway. + /// Protocol. Possible values are: 'Http' and + /// 'Https'. Possible values include: 'Http', 'Https' + /// Host name of HTTP listener. + /// SSL certificate resource of an + /// application gateway. + /// Applicable only if + /// protocol is https. Enables SNI for multi-hosting. + /// Provisioning state of the HTTP + /// listener resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. + public ApplicationGatewayHttpListener(string id = default(string), SubResource frontendIPConfiguration = default(SubResource), SubResource frontendPort = default(SubResource), string protocol = default(string), string hostName = default(string), SubResource sSLCertificate = default(SubResource), bool? requireServerNameIndication = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { FrontendIPConfiguration = frontendIPConfiguration; FrontendPort = frontendPort; Protocol = protocol; HostName = hostName; - SslCertificate = sslCertificate; + SSLCertificate = sSLCertificate; RequireServerNameIndication = requireServerNameIndication; ProvisioningState = provisioningState; Name = name; @@ -47,60 +61,63 @@ public ApplicationGatewayHttpListener() { } } /// - /// Frontend IP configuration resource of application gateway + /// Gets or sets frontend IP configuration resource of an application + /// gateway. /// - [JsonProperty(PropertyName = "properties.frontendIPConfiguration")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfiguration")] public SubResource FrontendIPConfiguration { get; set; } /// - /// Frontend port resource of application gateway + /// Gets or sets frontend port resource of an application gateway. /// - [JsonProperty(PropertyName = "properties.frontendPort")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPort")] public SubResource FrontendPort { get; set; } /// - /// Protocol. Possible values include: 'Http', 'Https' + /// Gets or sets protocol. Possible values are: 'Http' and 'Https'. + /// Possible values include: 'Http', 'Https' /// - [JsonProperty(PropertyName = "properties.protocol")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// - /// Host name of http listener + /// Gets or sets host name of HTTP listener. /// - [JsonProperty(PropertyName = "properties.hostName")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hostName")] public string HostName { get; set; } /// - /// Ssl certificate resource of application gateway + /// Gets or sets SSL certificate resource of an application gateway. /// - [JsonProperty(PropertyName = "properties.sslCertificate")] - public SubResource SslCertificate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.SSLCertificate")] + public SubResource SSLCertificate { get; set; } /// - /// RequireServerNameIndication of http listener + /// Gets or sets applicable only if protocol is https. Enables SNI for + /// multi-hosting. /// - [JsonProperty(PropertyName = "properties.requireServerNameIndication")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.requireServerNameIndication")] public bool? RequireServerNameIndication { get; set; } /// - /// Provisioning state of the http listener resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the HTTP listener resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayIpConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayIpConfiguration.cs index 4fd2cbc9f15dc..30e7d5a83c5d5 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayIpConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayIpConfiguration.cs @@ -2,24 +2,19 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// IP configuration of application gateway + /// IP configuration of an application gateway. Currently 1 public and 1 + /// private IP configuration is allowed. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayIPConfiguration : SubResource { /// @@ -32,6 +27,17 @@ public ApplicationGatewayIPConfiguration() { } /// Initializes a new instance of the /// ApplicationGatewayIPConfiguration class. /// + /// Resource ID. + /// Reference of the subnet resource. A subnet + /// from where application gateway gets its private address. + /// Provisioning state of the + /// application gateway subnet resource. Possible values are: + /// 'Updating', 'Deleting', and 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ApplicationGatewayIPConfiguration(string id = default(string), SubResource subnet = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -42,31 +48,32 @@ public ApplicationGatewayIPConfiguration() { } } /// - /// Reference of the subnet resource. A subnet from where application - /// gateway gets its private address + /// Gets or sets reference of the subnet resource. A subnet from where + /// application gateway gets its private address. /// - [JsonProperty(PropertyName = "properties.subnet")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] public SubResource Subnet { get; set; } /// - /// Provisioning state of the application gateway subnet resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the application gateway subnet + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayOperationalState.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayOperationalState.cs index 5ff7840130715..80ecacf9e26ef 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayOperationalState.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayOperationalState.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for ApplicationGatewayOperationalState. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayPathRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayPathRule.cs index 7d1933593224f..b822b881642de 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayPathRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayPathRule.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Path rule of URL path map of application gateway + /// Path rule of URL path map of an application gateway. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayPathRule : SubResource { /// @@ -30,7 +24,21 @@ public ApplicationGatewayPathRule() { } /// /// Initializes a new instance of the ApplicationGatewayPathRule class. /// - public ApplicationGatewayPathRule(string id = default(string), IList paths = default(IList), SubResource backendAddressPool = default(SubResource), SubResource backendHttpSettings = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string)) + /// Resource ID. + /// Path rules of URL path map. + /// Backend address pool resource of + /// URL path map. + /// Backend http settings resource + /// of URL path map. + /// Path rule of URL path map + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. + public ApplicationGatewayPathRule(string id = default(string), System.Collections.Generic.IList paths = default(System.Collections.Generic.IList), SubResource backendAddressPool = default(SubResource), SubResource backendHttpSettings = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { Paths = paths; @@ -42,41 +50,42 @@ public ApplicationGatewayPathRule() { } } /// - /// Path rules of URL path map + /// Gets or sets path rules of URL path map. /// - [JsonProperty(PropertyName = "properties.paths")] - public IList Paths { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.paths")] + public System.Collections.Generic.IList Paths { get; set; } /// - /// Backend address pool resource of URL path map + /// Gets or sets backend address pool resource of URL path map. /// - [JsonProperty(PropertyName = "properties.backendAddressPool")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPool")] public SubResource BackendAddressPool { get; set; } /// - /// Backend http settings resource of URL path map + /// Gets or sets backend http settings resource of URL path map. /// - [JsonProperty(PropertyName = "properties.backendHttpSettings")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendHttpSettings")] public SubResource BackendHttpSettings { get; set; } /// - /// Path rule of URL path map resource Updating/Deleting/Failed + /// Gets or sets path rule of URL path map resource. Possible values + /// are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProbe.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProbe.cs index b750d7e3669eb..02365e2d42fe8 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProbe.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProbe.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Probe of application gateway + /// Probe of the application gateway. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayProbe : SubResource { /// @@ -30,6 +24,31 @@ public ApplicationGatewayProbe() { } /// /// Initializes a new instance of the ApplicationGatewayProbe class. /// + /// Resource ID. + /// Protocol. Possible values are: 'Http' and + /// 'Https'. Possible values include: 'Http', 'Https' + /// Host name to send the probe to. + /// Relative path of probe. Valid path starts from + /// '/'. Probe is sent to ://: + /// The probing interval in seconds. This is + /// the time interval between two consecutive probes. Acceptable + /// values are from 1 second to 86400 seconds. + /// the probe timeout in seconds. Probe marked + /// as failed if valid response is not received with this timeout + /// period. Acceptable values are from 1 second to 86400 + /// seconds. + /// The probe retry count. Backend + /// server is marked down after consecutive probe failure count + /// reaches UnhealthyThreshold. Acceptable values are from 1 second + /// to 20. + /// Provisioning state of the backend + /// http settings resource. Possible values are: 'Updating', + /// 'Deleting', and 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ApplicationGatewayProbe(string id = default(string), string protocol = default(string), string host = default(string), string path = default(string), int? interval = default(int?), int? timeout = default(int?), int? unhealthyThreshold = default(int?), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -45,60 +64,70 @@ public ApplicationGatewayProbe() { } } /// - /// Protocol. Possible values include: 'Http', 'Https' + /// Gets or sets protocol. Possible values are: 'Http' and 'Https'. + /// Possible values include: 'Http', 'Https' /// - [JsonProperty(PropertyName = "properties.protocol")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// - /// Host to send probe to + /// Gets or sets host name to send the probe to. /// - [JsonProperty(PropertyName = "properties.host")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.host")] public string Host { get; set; } /// - /// Relative path of probe + /// Gets or sets relative path of probe. Valid path starts from '/'. + /// Probe is sent to + /// <Protocol>://<host>:<port><path> /// - [JsonProperty(PropertyName = "properties.path")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.path")] public string Path { get; set; } /// - /// Probing interval in seconds + /// Gets or sets the probing interval in seconds. This is the time + /// interval between two consecutive probes. Acceptable values are + /// from 1 second to 86400 seconds. /// - [JsonProperty(PropertyName = "properties.interval")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.interval")] public int? Interval { get; set; } /// - /// Probing timeout in seconds + /// Gets or sets the probe timeout in seconds. Probe marked as failed + /// if valid response is not received with this timeout period. + /// Acceptable values are from 1 second to 86400 seconds. /// - [JsonProperty(PropertyName = "properties.timeout")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeout")] public int? Timeout { get; set; } /// - /// Probing unhealthy threshold + /// Gets or sets the probe retry count. Backend server is marked down + /// after consecutive probe failure count reaches UnhealthyThreshold. + /// Acceptable values are from 1 second to 20. /// - [JsonProperty(PropertyName = "properties.unhealthyThreshold")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.unhealthyThreshold")] public int? UnhealthyThreshold { get; set; } /// - /// Provisioning state of the backend http settings resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the backend http settings + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProtocol.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProtocol.cs index 84615f1660ece..f0178991a55a6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProtocol.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProtocol.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for ApplicationGatewayProtocol. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRule.cs index c8d3a9f86e06c..2f91b2158b984 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRule.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Request routing rule of application gateway + /// Request routing rule of an application gateway. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayRequestRoutingRule : SubResource { /// @@ -32,6 +26,26 @@ public ApplicationGatewayRequestRoutingRule() { } /// Initializes a new instance of the /// ApplicationGatewayRequestRoutingRule class. /// + /// Resource ID. + /// Rule type. Possible values are: 'Basic' and + /// 'PathBasedRouting'. Possible values include: 'Basic', + /// 'PathBasedRouting' + /// Backend address pool resource of + /// the application gateway. + /// Frontend port resource of the + /// application gateway. + /// Http listener resource of the + /// application gateway. + /// URL path map resource of the application + /// gateway. + /// Provisioning state of the request + /// routing rule resource. Possible values are: 'Updating', + /// 'Deleting', and 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ApplicationGatewayRequestRoutingRule(string id = default(string), string ruleType = default(string), SubResource backendAddressPool = default(SubResource), SubResource backendHttpSettings = default(SubResource), SubResource httpListener = default(SubResource), SubResource urlPathMap = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -46,54 +60,58 @@ public ApplicationGatewayRequestRoutingRule() { } } /// - /// Rule type. Possible values include: 'Basic', 'PathBasedRouting' + /// Gets or sets rule type. Possible values are: 'Basic' and + /// 'PathBasedRouting'. Possible values include: 'Basic', + /// 'PathBasedRouting' /// - [JsonProperty(PropertyName = "properties.ruleType")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ruleType")] public string RuleType { get; set; } /// - /// Backend address pool resource of application gateway + /// Gets or sets backend address pool resource of the application + /// gateway. /// - [JsonProperty(PropertyName = "properties.backendAddressPool")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPool")] public SubResource BackendAddressPool { get; set; } /// - /// Frontend port resource of application gateway + /// Gets or sets frontend port resource of the application gateway. /// - [JsonProperty(PropertyName = "properties.backendHttpSettings")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendHttpSettings")] public SubResource BackendHttpSettings { get; set; } /// - /// Http listener resource of application gateway + /// Gets or sets http listener resource of the application gateway. /// - [JsonProperty(PropertyName = "properties.httpListener")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.httpListener")] public SubResource HttpListener { get; set; } /// - /// Url path map resource of application gateway + /// Gets or sets URL path map resource of the application gateway. /// - [JsonProperty(PropertyName = "properties.urlPathMap")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.urlPathMap")] public SubResource UrlPathMap { get; set; } /// - /// Provisioning state of the request routing rule resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the request routing rule + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRuleType.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRuleType.cs index 2b80cedf99844..95268fdd91661 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRuleType.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRuleType.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for ApplicationGatewayRequestRoutingRuleType. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySku.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySku.cs index e38214f7b7393..39756484757d6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySku.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySku.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// SKU of application gateway + /// SKU of an application gateway /// public partial class ApplicationGatewaySku { @@ -29,6 +23,16 @@ public ApplicationGatewaySku() { } /// /// Initializes a new instance of the ApplicationGatewaySku class. /// + /// Name of an application gateway SKU. Possible + /// values are: 'Standard_Small', 'Standard_Medium', + /// 'Standard_Large', 'WAF_Medium', and 'WAF_Large'. Possible values + /// include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', + /// 'WAF_Medium', 'WAF_Large' + /// Tier of an application gateway. Possible values + /// are: 'Standard' and 'WAF'. Possible values include: 'Standard', + /// 'WAF' + /// Capacity (instance count) of an application + /// gateway. public ApplicationGatewaySku(string name = default(string), string tier = default(string), int? capacity = default(int?)) { Name = name; @@ -37,24 +41,26 @@ public ApplicationGatewaySku() { } } /// - /// Name of application gateway SKU. Possible values include: + /// Gets or sets name of an application gateway SKU. Possible values + /// are: 'Standard_Small', 'Standard_Medium', 'Standard_Large', + /// 'WAF_Medium', and 'WAF_Large'. Possible values include: /// 'Standard_Small', 'Standard_Medium', 'Standard_Large', /// 'WAF_Medium', 'WAF_Large' /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// Tier of application gateway. Possible values include: 'Standard', - /// 'WAF' + /// Gets or sets tier of an application gateway. Possible values are: + /// 'Standard' and 'WAF'. Possible values include: 'Standard', 'WAF' /// - [JsonProperty(PropertyName = "tier")] + [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] public string Tier { get; set; } /// - /// Capacity (instance count) of application gateway + /// Gets or sets capacity (instance count) of an application gateway. /// - [JsonProperty(PropertyName = "capacity")] + [Newtonsoft.Json.JsonProperty(PropertyName = "capacity")] public int? Capacity { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySkuName.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySkuName.cs index 53a29d1e5e4f1..56356dcf1342b 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySkuName.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySkuName.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for ApplicationGatewaySkuName. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslCertificate.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslCertificate.cs index 70f836467944e..e0b9db8e32b99 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslCertificate.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslCertificate.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// SSL certificates of application gateway + /// SSL certificates of an application gateway. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewaySslCertificate : SubResource { /// @@ -32,6 +26,22 @@ public ApplicationGatewaySslCertificate() { } /// Initializes a new instance of the ApplicationGatewaySslCertificate /// class. /// + /// Resource ID. + /// Base-64 encoded pfx certificate. Only + /// applicable in PUT Request. + /// Password for the pfx file specified in + /// data. Only applicable in PUT request. + /// Base-64 encoded Public cert data + /// corresponding to pfx specified in data. Only applicable in GET + /// request. + /// Provisioning state of the SSL + /// certificate resource Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ApplicationGatewaySslCertificate(string id = default(string), string data = default(string), string password = default(string), string publicCertData = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -44,42 +54,45 @@ public ApplicationGatewaySslCertificate() { } } /// - /// SSL Certificate data + /// Gets or sets base-64 encoded pfx certificate. Only applicable in + /// PUT Request. /// - [JsonProperty(PropertyName = "properties.data")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.data")] public string Data { get; set; } /// - /// SSL Certificate password + /// Gets or sets password for the pfx file specified in data. Only + /// applicable in PUT request. /// - [JsonProperty(PropertyName = "properties.password")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.password")] public string Password { get; set; } /// - /// SSL Certificate public data + /// Gets or sets base-64 encoded Public cert data corresponding to pfx + /// specified in data. Only applicable in GET request. /// - [JsonProperty(PropertyName = "properties.publicCertData")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicCertData")] public string PublicCertData { get; set; } /// - /// Provisioning state of the ssl certificate resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the SSL certificate resource + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslPolicy.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslPolicy.cs index 8d48f5a16d258..682c67093e487 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslPolicy.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslPolicy.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Application gateway SSL policy + /// Application gateway SSL policy. /// public partial class ApplicationGatewaySslPolicy { @@ -31,16 +25,20 @@ public ApplicationGatewaySslPolicy() { } /// Initializes a new instance of the ApplicationGatewaySslPolicy /// class. /// - public ApplicationGatewaySslPolicy(IList disabledSslProtocols = default(IList)) + /// SSL protocols to be disabled on + /// application gateway. Possible values are: 'TLSv1_0', 'TLSv1_1', + /// and 'TLSv1_2'. + public ApplicationGatewaySslPolicy(System.Collections.Generic.IList disabledSslProtocols = default(System.Collections.Generic.IList)) { DisabledSslProtocols = disabledSslProtocols; } /// - /// SSL protocols to be disabled on Application Gateway + /// Gets or sets SSL protocols to be disabled on application gateway. + /// Possible values are: 'TLSv1_0', 'TLSv1_1', and 'TLSv1_2'. /// - [JsonProperty(PropertyName = "disabledSslProtocols")] - public IList DisabledSslProtocols { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "disabledSslProtocols")] + public System.Collections.Generic.IList DisabledSslProtocols { get; set; } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslProtocol.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslProtocol.cs index 4d1375da71aaf..78d050f50a6fa 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslProtocol.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslProtocol.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for ApplicationGatewaySslProtocol. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayTier.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayTier.cs index 341660c2f1aa8..9a4a3b604044d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayTier.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayTier.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for ApplicationGatewayTier. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayUrlPathMap.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayUrlPathMap.cs index 407fbef7b2d05..2b26e1d036a09 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayUrlPathMap.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayUrlPathMap.cs @@ -2,24 +2,19 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// UrlPathMap of application gateway + /// UrlPathMaps give a url path to the backend mapping information for + /// PathBasedRouting. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicationGatewayUrlPathMap : SubResource { /// @@ -32,7 +27,21 @@ public ApplicationGatewayUrlPathMap() { } /// Initializes a new instance of the ApplicationGatewayUrlPathMap /// class. /// - public ApplicationGatewayUrlPathMap(string id = default(string), SubResource defaultBackendAddressPool = default(SubResource), SubResource defaultBackendHttpSettings = default(SubResource), IList pathRules = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) + /// Resource ID. + /// Default backend address + /// pool resource of URL path map. + /// Default backend http + /// settings resource of URL path map. + /// Path rule of URL path map resource. + /// Provisioning state of the backend + /// http settings resource. Possible values are: 'Updating', + /// 'Deleting', and 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. + public ApplicationGatewayUrlPathMap(string id = default(string), SubResource defaultBackendAddressPool = default(SubResource), SubResource defaultBackendHttpSettings = default(SubResource), System.Collections.Generic.IList pathRules = default(System.Collections.Generic.IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { DefaultBackendAddressPool = defaultBackendAddressPool; @@ -44,42 +53,44 @@ public ApplicationGatewayUrlPathMap() { } } /// - /// Default backend address pool resource of URL path map + /// Gets or sets default backend address pool resource of URL path map. /// - [JsonProperty(PropertyName = "properties.defaultBackendAddressPool")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultBackendAddressPool")] public SubResource DefaultBackendAddressPool { get; set; } /// - /// Default backend http settings resource of URL path map + /// Gets or sets default backend http settings resource of URL path + /// map. /// - [JsonProperty(PropertyName = "properties.defaultBackendHttpSettings")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultBackendHttpSettings")] public SubResource DefaultBackendHttpSettings { get; set; } /// - /// Path rule of URL path map resource + /// Gets or sets path rule of URL path map resource. /// - [JsonProperty(PropertyName = "properties.pathRules")] - public IList PathRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.pathRules")] + public System.Collections.Generic.IList PathRules { get; set; } /// - /// Provisioning state of the backend http settings resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the backend http settings + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayWebApplicationFirewallConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayWebApplicationFirewallConfiguration.cs index 67045b53f2446..3c501192f77d0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayWebApplicationFirewallConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayWebApplicationFirewallConfiguration.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Application gateway web application firewall configuration + /// Application gateway web application firewall configuration. /// public partial class ApplicationGatewayWebApplicationFirewallConfiguration { @@ -31,6 +25,11 @@ public ApplicationGatewayWebApplicationFirewallConfiguration() { } /// Initializes a new instance of the /// ApplicationGatewayWebApplicationFirewallConfiguration class. /// + /// Whether the web application firewall is + /// enabled. + /// Web application firewall mode. Possible + /// values are: 'Detection' and 'Prevention'. Possible values + /// include: 'Detection', 'Prevention' public ApplicationGatewayWebApplicationFirewallConfiguration(bool enabled, string firewallMode = default(string)) { Enabled = enabled; @@ -38,21 +37,25 @@ public ApplicationGatewayWebApplicationFirewallConfiguration() { } } /// - /// Whether web application firewall is enabled + /// Gets or sets whether the web application firewall is enabled. /// - [JsonProperty(PropertyName = "enabled")] + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] public bool Enabled { get; set; } /// - /// Web application firewall mode. Possible values include: + /// Gets or sets web application firewall mode. Possible values are: + /// 'Detection' and 'Prevention'. Possible values include: /// 'Detection', 'Prevention' /// - [JsonProperty(PropertyName = "firewallMode")] + [Newtonsoft.Json.JsonProperty(PropertyName = "firewallMode")] public string FirewallMode { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { //Nothing to validate diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AuthorizationUseStatus.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AuthorizationUseStatus.cs index dd97c59d5bf8c..010f347bc0216 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AuthorizationUseStatus.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AuthorizationUseStatus.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for AuthorizationUseStatus. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AzureAsyncOperationResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AzureAsyncOperationResult.cs index 2d9844f996231..0565dc172bb1a 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AzureAsyncOperationResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AzureAsyncOperationResult.cs @@ -2,19 +2,13 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// /// The response body contains the status of the specified asynchronous @@ -36,6 +30,9 @@ public AzureAsyncOperationResult() { } /// /// Initializes a new instance of the AzureAsyncOperationResult class. /// + /// Status of the Azure async operation. Possible + /// values are: 'InProgress', 'Succeeded', and 'Failed'. Possible + /// values include: 'InProgress', 'Succeeded', 'Failed' public AzureAsyncOperationResult(string status = default(string), Error error = default(Error)) { Status = status; @@ -43,15 +40,16 @@ public AzureAsyncOperationResult() { } } /// - /// Status of the AzureAsuncOperation. Possible values include: - /// 'InProgress', 'Succeeded', 'Failed' + /// Gets or sets status of the Azure async operation. Possible values + /// are: 'InProgress', 'Succeeded', and 'Failed'. Possible values + /// include: 'InProgress', 'Succeeded', 'Failed' /// - [JsonProperty(PropertyName = "status")] + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] public string Status { get; set; } /// /// - [JsonProperty(PropertyName = "error")] + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] public Error Error { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BackendAddressPool.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BackendAddressPool.cs index ff718a31743c5..626183feb9f1f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BackendAddressPool.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BackendAddressPool.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Pool of backend IP addresses + /// Pool of backend IP addresses. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class BackendAddressPool : SubResource { /// @@ -30,7 +24,22 @@ public BackendAddressPool() { } /// /// Initializes a new instance of the BackendAddressPool class. /// - public BackendAddressPool(string id = default(string), IList backendIPConfigurations = default(IList), IList loadBalancingRules = default(IList), SubResource outboundNatRule = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string)) + /// Resource ID. + /// Gets collection of + /// references to IP addresses defined in network interfaces. + /// Gets load balancing rules that + /// use this backend address pool. + /// Gets outbound rules that use this + /// backend address pool. + /// Get provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// Gets name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. + public BackendAddressPool(string id = default(string), System.Collections.Generic.IList backendIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancingRules = default(System.Collections.Generic.IList), SubResource outboundNatRule = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { BackendIPConfigurations = backendIPConfigurations; @@ -42,42 +51,43 @@ public BackendAddressPool() { } } /// - /// Gets collection of references to IPs defined in NICs + /// Gets collection of references to IP addresses defined in network + /// interfaces. /// - [JsonProperty(PropertyName = "properties.backendIPConfigurations")] - public IList BackendIPConfigurations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendIPConfigurations")] + public System.Collections.Generic.IList BackendIPConfigurations { get; private set; } /// - /// Gets Load Balancing rules that use this Backend Address Pool + /// Gets load balancing rules that use this backend address pool. /// - [JsonProperty(PropertyName = "properties.loadBalancingRules")] - public IList LoadBalancingRules { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancingRules")] + public System.Collections.Generic.IList LoadBalancingRules { get; private set; } /// - /// Gets outbound rules that use this Backend Address Pool + /// Gets outbound rules that use this backend address pool. /// - [JsonProperty(PropertyName = "properties.outboundNatRule")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.outboundNatRule")] public SubResource OutboundNatRule { get; private set; } /// - /// Get provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets or sets get provisioning state of the public IP resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BgpSettings.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BgpSettings.cs index 3169daa9866bc..5d5e24f448ad8 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BgpSettings.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BgpSettings.cs @@ -2,19 +2,13 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; public partial class BgpSettings { @@ -26,6 +20,11 @@ public BgpSettings() { } /// /// Initializes a new instance of the BgpSettings class. /// + /// The BGP speaker's ASN. + /// The BGP peering address and BGP + /// identifier of this BGP speaker. + /// The weight added to routes learned from + /// this BGP speaker. public BgpSettings(long? asn = default(long?), string bgpPeeringAddress = default(string), int? peerWeight = default(int?)) { Asn = asn; @@ -34,23 +33,23 @@ public BgpSettings() { } } /// - /// Gets or sets this BGP speaker's ASN + /// Gets or sets the BGP speaker's ASN. /// - [JsonProperty(PropertyName = "asn")] + [Newtonsoft.Json.JsonProperty(PropertyName = "asn")] public long? Asn { get; set; } /// /// Gets or sets the BGP peering address and BGP identifier of this - /// BGP speaker + /// BGP speaker. /// - [JsonProperty(PropertyName = "bgpPeeringAddress")] + [Newtonsoft.Json.JsonProperty(PropertyName = "bgpPeeringAddress")] public string BgpPeeringAddress { get; set; } /// /// Gets or sets the weight added to routes learned from this BGP - /// speaker + /// speaker. /// - [JsonProperty(PropertyName = "peerWeight")] + [Newtonsoft.Json.JsonProperty(PropertyName = "peerWeight")] public int? PeerWeight { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionResetSharedKey.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionResetSharedKey.cs index debca21a1aacc..b49aaf86aa073 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionResetSharedKey.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionResetSharedKey.cs @@ -2,19 +2,13 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; public partial class ConnectionResetSharedKey { @@ -26,30 +20,35 @@ public ConnectionResetSharedKey() { } /// /// Initializes a new instance of the ConnectionResetSharedKey class. /// + /// The virtual network connection reset + /// shared key length, should between 1 and 128. public ConnectionResetSharedKey(int keyLength) { KeyLength = keyLength; } /// - /// The virtual network connection reset shared key length, should - /// between 1 and 128. + /// Gets or sets the virtual network connection reset shared key + /// length, should between 1 and 128. /// - [JsonProperty(PropertyName = "keyLength")] + [Newtonsoft.Json.JsonProperty(PropertyName = "keyLength")] public int KeyLength { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (this.KeyLength > 128) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "KeyLength", 128); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "KeyLength", 128); } if (this.KeyLength < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "KeyLength", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "KeyLength", 1); } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionSharedKey.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionSharedKey.cs index 378cf17eae8df..191d129a18754 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionSharedKey.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionSharedKey.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Response for GetConnectionSharedKey Api service call + /// Response for GetConnectionSharedKey API service call /// public partial class ConnectionSharedKey { @@ -29,25 +23,30 @@ public ConnectionSharedKey() { } /// /// Initializes a new instance of the ConnectionSharedKey class. /// + /// The virtual network connection shared key + /// value. public ConnectionSharedKey(string value) { Value = value; } /// - /// The virtual network connection shared key value + /// Gets or sets the virtual network connection shared key value. /// - [JsonProperty(PropertyName = "value")] + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] public string Value { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (Value == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Value"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Value"); } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DhcpOptions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DhcpOptions.cs index df31cd86068c6..3dbf10ee7f70b 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DhcpOptions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DhcpOptions.cs @@ -2,23 +2,17 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// DHCPOptions contains an array of DNS servers available to VMs deployed - /// in the virtual networkStandard DHCP option for a subnet overrides + /// DhcpOptions contains an array of DNS servers available to VMs deployed + /// in the virtual network. Standard DHCP option for a subnet overrides /// VNET DHCP options. /// public partial class DhcpOptions @@ -31,16 +25,18 @@ public DhcpOptions() { } /// /// Initializes a new instance of the DhcpOptions class. /// - public DhcpOptions(IList dnsServers = default(IList)) + /// The list of DNS servers IP + /// addresses. + public DhcpOptions(System.Collections.Generic.IList dnsServers = default(System.Collections.Generic.IList)) { DnsServers = dnsServers; } /// - /// Gets or sets list of DNS servers IP addresses + /// Gets or sets the list of DNS servers IP addresses. /// - [JsonProperty(PropertyName = "dnsServers")] - public IList DnsServers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dnsServers")] + public System.Collections.Generic.IList DnsServers { get; set; } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DnsNameAvailabilityResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DnsNameAvailabilityResult.cs index 5f8661fc31cf6..5b1d0e9e24400 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DnsNameAvailabilityResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DnsNameAvailabilityResult.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Response for CheckDnsNameAvailability Api service call + /// Response for the CheckDnsNameAvailability API service call. /// public partial class DnsNameAvailabilityResult { @@ -29,15 +23,16 @@ public DnsNameAvailabilityResult() { } /// /// Initializes a new instance of the DnsNameAvailabilityResult class. /// + /// Domain availability (True/False). public DnsNameAvailabilityResult(bool? available = default(bool?)) { Available = available; } /// - /// Domain availability (True/False) + /// Gets or sets domain availability (True/False). /// - [JsonProperty(PropertyName = "available")] + [Newtonsoft.Json.JsonProperty(PropertyName = "available")] public bool? Available { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroup.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroup.cs index 26a101149165d..af4814e77274e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroup.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroup.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Effective NetworkSecurityGroup + /// Effective network security group. /// public partial class EffectiveNetworkSecurityGroup { @@ -31,7 +25,11 @@ public EffectiveNetworkSecurityGroup() { } /// Initializes a new instance of the EffectiveNetworkSecurityGroup /// class. /// - public EffectiveNetworkSecurityGroup(SubResource networkSecurityGroup = default(SubResource), EffectiveNetworkSecurityGroupAssociation association = default(EffectiveNetworkSecurityGroupAssociation), IList effectiveSecurityRules = default(IList)) + /// The ID of network security + /// group that is applied. + /// A collection of effective + /// security rules. + public EffectiveNetworkSecurityGroup(SubResource networkSecurityGroup = default(SubResource), EffectiveNetworkSecurityGroupAssociation association = default(EffectiveNetworkSecurityGroupAssociation), System.Collections.Generic.IList effectiveSecurityRules = default(System.Collections.Generic.IList)) { NetworkSecurityGroup = networkSecurityGroup; Association = association; @@ -39,21 +37,21 @@ public EffectiveNetworkSecurityGroup() { } } /// - /// Gets the id of network security group that is applied + /// Gets or sets the ID of network security group that is applied. /// - [JsonProperty(PropertyName = "networkSecurityGroup")] + [Newtonsoft.Json.JsonProperty(PropertyName = "networkSecurityGroup")] public SubResource NetworkSecurityGroup { get; set; } /// /// - [JsonProperty(PropertyName = "association")] + [Newtonsoft.Json.JsonProperty(PropertyName = "association")] public EffectiveNetworkSecurityGroupAssociation Association { get; set; } /// - /// Gets collection of effective security rules + /// Gets or sets a collection of effective security rules. /// - [JsonProperty(PropertyName = "effectiveSecurityRules")] - public IList EffectiveSecurityRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "effectiveSecurityRules")] + public System.Collections.Generic.IList EffectiveSecurityRules { get; set; } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs index 48c96248db113..4a6b4529e1e31 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Effective NetworkSecurityGroup association + /// The effective network security group association. /// public partial class EffectiveNetworkSecurityGroupAssociation { @@ -31,6 +25,9 @@ public EffectiveNetworkSecurityGroupAssociation() { } /// Initializes a new instance of the /// EffectiveNetworkSecurityGroupAssociation class. /// + /// The ID of the subnet if assigned. + /// The ID of the network interface if + /// assigned. public EffectiveNetworkSecurityGroupAssociation(SubResource subnet = default(SubResource), SubResource networkInterface = default(SubResource)) { Subnet = subnet; @@ -38,15 +35,15 @@ public EffectiveNetworkSecurityGroupAssociation() { } } /// - /// Gets the id of subnet if assigned + /// Gets or sets the ID of the subnet if assigned. /// - [JsonProperty(PropertyName = "subnet")] + [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] public SubResource Subnet { get; set; } /// - /// Gets the id of network interface if assigned + /// Gets or sets the ID of the network interface if assigned. /// - [JsonProperty(PropertyName = "networkInterface")] + [Newtonsoft.Json.JsonProperty(PropertyName = "networkInterface")] public SubResource NetworkInterface { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupListResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupListResult.cs index 23ea2b9fd7d84..6428968dfe4cb 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupListResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupListResult.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Response for list effective network security groups api service call + /// Response for list effective network security groups API service call. /// public partial class EffectiveNetworkSecurityGroupListResult { @@ -31,22 +25,26 @@ public EffectiveNetworkSecurityGroupListResult() { } /// Initializes a new instance of the /// EffectiveNetworkSecurityGroupListResult class. /// - public EffectiveNetworkSecurityGroupListResult(IList value = default(IList), string nextLink = default(string)) + /// A list of effective network security + /// groups. + /// The URL to get the next set of + /// results. + public EffectiveNetworkSecurityGroupListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) { Value = value; NextLink = nextLink; } /// - /// Gets list of effective network security groups + /// Gets or sets a list of effective network security groups. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value { get; set; } /// - /// Gets the URL to get the next set of results. + /// Gets or sets the URL to get the next set of results. /// - [JsonProperty(PropertyName = "nextLink")] + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] public string NextLink { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityRule.cs index 79cdcdc78dc1b..da1d6a753a5a2 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityRule.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Effective NetworkSecurityRules + /// Effective network security rules. /// public partial class EffectiveNetworkSecurityRule { @@ -31,7 +25,30 @@ public EffectiveNetworkSecurityRule() { } /// Initializes a new instance of the EffectiveNetworkSecurityRule /// class. /// - public EffectiveNetworkSecurityRule(string name = default(string), string protocol = default(string), string sourcePortRange = default(string), string destinationPortRange = default(string), string sourceAddressPrefix = default(string), string destinationAddressPrefix = default(string), IList expandedSourceAddressPrefix = default(IList), IList expandedDestinationAddressPrefix = default(IList), string access = default(string), int? priority = default(int?), string direction = default(string)) + /// The name of the security rule specified by the + /// user (if created by the user). + /// The network protocol this rule applies to. + /// Possible values are: 'Tcp', 'Udp', and '*'. Possible values + /// include: 'Tcp', 'Udp', '*' + /// The source port or range. + /// The destination port or + /// range. + /// The source address + /// prefix. + /// The destination address + /// prefix. + /// The expanded source + /// address prefix. + /// Expanded + /// destination address prefix. + /// Whether network traffic is allowed or denied. + /// Possible values are: 'Allow' and 'Deny'. Possible values include: + /// 'Allow', 'Deny' + /// The priority of the rule. + /// The direction of the rule. Possible values + /// are: 'Inbound and Outbound'. Possible values include: 'Inbound', + /// 'Outbound' + public EffectiveNetworkSecurityRule(string name = default(string), string protocol = default(string), string sourcePortRange = default(string), string destinationPortRange = default(string), string sourceAddressPrefix = default(string), string destinationAddressPrefix = default(string), System.Collections.Generic.IList expandedSourceAddressPrefix = default(System.Collections.Generic.IList), System.Collections.Generic.IList expandedDestinationAddressPrefix = default(System.Collections.Generic.IList), string access = default(string), int? priority = default(int?), string direction = default(string)) { Name = name; Protocol = protocol; @@ -47,73 +64,76 @@ public EffectiveNetworkSecurityRule() { } } /// - /// Gets the name of the security rule specified by the user (if - /// created by the user) + /// Gets or sets the name of the security rule specified by the user + /// (if created by the user). /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// Gets Network protocol this rule applies to. Possible values - /// include: 'Tcp', 'Udp', '*' + /// Gets or sets the network protocol this rule applies to. Possible + /// values are: 'Tcp', 'Udp', and '*'. Possible values include: + /// 'Tcp', 'Udp', '*' /// - [JsonProperty(PropertyName = "protocol")] + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] public string Protocol { get; set; } /// - /// Gets source port or range + /// Gets or sets the source port or range. /// - [JsonProperty(PropertyName = "sourcePortRange")] + [Newtonsoft.Json.JsonProperty(PropertyName = "sourcePortRange")] public string SourcePortRange { get; set; } /// - /// Gets destination port or range + /// Gets or sets the destination port or range. /// - [JsonProperty(PropertyName = "destinationPortRange")] + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPortRange")] public string DestinationPortRange { get; set; } /// - /// Gets source address prefix + /// Gets or sets the source address prefix. /// - [JsonProperty(PropertyName = "sourceAddressPrefix")] + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceAddressPrefix")] public string SourceAddressPrefix { get; set; } /// - /// Gets destination address prefix + /// Gets or sets the destination address prefix. /// - [JsonProperty(PropertyName = "destinationAddressPrefix")] + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationAddressPrefix")] public string DestinationAddressPrefix { get; set; } /// - /// Gets expanded source address prefix + /// Gets or sets the expanded source address prefix. /// - [JsonProperty(PropertyName = "expandedSourceAddressPrefix")] - public IList ExpandedSourceAddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "expandedSourceAddressPrefix")] + public System.Collections.Generic.IList ExpandedSourceAddressPrefix { get; set; } /// - /// Gets expanded destination address prefix + /// Gets or sets expanded destination address prefix. /// - [JsonProperty(PropertyName = "expandedDestinationAddressPrefix")] - public IList ExpandedDestinationAddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "expandedDestinationAddressPrefix")] + public System.Collections.Generic.IList ExpandedDestinationAddressPrefix { get; set; } /// - /// Gets network traffic is allowed or denied. Possible values - /// include: 'Allow', 'Deny' + /// Gets or sets whether network traffic is allowed or denied. + /// Possible values are: 'Allow' and 'Deny'. Possible values include: + /// 'Allow', 'Deny' /// - [JsonProperty(PropertyName = "access")] + [Newtonsoft.Json.JsonProperty(PropertyName = "access")] public string Access { get; set; } /// - /// Gets the priority of the rule + /// Gets or sets the priority of the rule. /// - [JsonProperty(PropertyName = "priority")] + [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] public int? Priority { get; set; } /// - /// Gets the direction of the rule. Possible values include: - /// 'Inbound', 'Outbound' + /// Gets or sets the direction of the rule. Possible values are: + /// 'Inbound and Outbound'. Possible values include: 'Inbound', + /// 'Outbound' /// - [JsonProperty(PropertyName = "direction")] + [Newtonsoft.Json.JsonProperty(PropertyName = "direction")] public string Direction { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRoute.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRoute.cs index 5a0f2366fbe8d..92d1ceb387bcf 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRoute.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRoute.cs @@ -2,19 +2,13 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// /// Effective Route @@ -29,7 +23,25 @@ public EffectiveRoute() { } /// /// Initializes a new instance of the EffectiveRoute class. /// - public EffectiveRoute(string name = default(string), string source = default(string), string state = default(string), IList addressPrefix = default(IList), IList nextHopIpAddress = default(IList), string nextHopType = default(string)) + /// The name of the user defined route. This is + /// optional. + /// Who created the route. Possible values are: + /// 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. + /// Possible values include: 'Unknown', 'User', + /// 'VirtualNetworkGateway', 'Default' + /// The value of effective route. Possible values + /// are: 'Active' and 'Invalid'. Possible values include: 'Active', + /// 'Invalid' + /// The address prefixes of the effective + /// routes in CIDR notation. + /// The IP address of the next hop of + /// the effective route. + /// The type of Azure hop the packet should + /// be sent to. Possible values are: 'VirtualNetworkGateway', + /// 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible + /// values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + /// 'VirtualAppliance', 'None' + public EffectiveRoute(string name = default(string), string source = default(string), string state = default(string), System.Collections.Generic.IList addressPrefix = default(System.Collections.Generic.IList), System.Collections.Generic.IList nextHopIpAddress = default(System.Collections.Generic.IList), string nextHopType = default(string)) { Name = name; Source = source; @@ -40,43 +52,49 @@ public EffectiveRoute() { } } /// - /// Gets the name of the user defined route. This is optional. + /// Gets or sets the name of the user defined route. This is optional. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// Gets who created the route. Possible values include: 'Unknown', - /// 'User', 'VirtualNetworkGateway', 'Default' + /// Gets or sets who created the route. Possible values are: + /// 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. + /// Possible values include: 'Unknown', 'User', + /// 'VirtualNetworkGateway', 'Default' /// - [JsonProperty(PropertyName = "source")] + [Newtonsoft.Json.JsonProperty(PropertyName = "source")] public string Source { get; set; } /// - /// Gets value of effective route. Possible values include: 'Active', + /// Gets or sets the value of effective route. Possible values are: + /// 'Active' and 'Invalid'. Possible values include: 'Active', /// 'Invalid' /// - [JsonProperty(PropertyName = "state")] + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] public string State { get; set; } /// - /// Gets address prefixes of the effective routes in CIDR notation. + /// Gets or sets the address prefixes of the effective routes in CIDR + /// notation. /// - [JsonProperty(PropertyName = "addressPrefix")] - public IList AddressPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefix")] + public System.Collections.Generic.IList AddressPrefix { get; set; } /// - /// Gets the IP address of the next hop of the effective route + /// Gets or sets the IP address of the next hop of the effective route. /// - [JsonProperty(PropertyName = "nextHopIpAddress")] - public IList NextHopIpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHopIpAddress")] + public System.Collections.Generic.IList NextHopIpAddress { get; set; } /// /// Gets or sets the type of Azure hop the packet should be sent to. - /// Possible values include: 'VirtualNetworkGateway', 'VnetLocal', - /// 'Internet', 'VirtualAppliance', 'None' + /// Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + /// 'Internet', 'VirtualAppliance', and 'None'. Possible values + /// include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + /// 'VirtualAppliance', 'None' /// - [JsonProperty(PropertyName = "nextHopType")] + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHopType")] public string NextHopType { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteListResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteListResult.cs index 2e2cf7dde98db..6cf62a7c8da2d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteListResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteListResult.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Response for list effective route api service call + /// Response for list effective route API service call. /// public partial class EffectiveRouteListResult { @@ -29,22 +23,25 @@ public EffectiveRouteListResult() { } /// /// Initializes a new instance of the EffectiveRouteListResult class. /// - public EffectiveRouteListResult(IList value = default(IList), string nextLink = default(string)) + /// A list of effective routes. + /// The URL to get the next set of + /// results. + public EffectiveRouteListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) { Value = value; NextLink = nextLink; } /// - /// Gets list of effective routes + /// Gets or sets a list of effective routes. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value { get; set; } /// - /// Gets the URL to get the next set of results. + /// Gets or sets the URL to get the next set of results. /// - [JsonProperty(PropertyName = "nextLink")] + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] public string NextLink { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteSource.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteSource.cs index c186c024848f1..ffe06b8cfc2e6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteSource.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteSource.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for EffectiveRouteSource. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteState.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteState.cs index 0961ccc1fc1bb..17a15ba93e93f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteState.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteState.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for EffectiveRouteState. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Error.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Error.cs index 65df22a40cea0..83c7c158567da 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Error.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Error.cs @@ -2,19 +2,13 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; public partial class Error { @@ -26,7 +20,7 @@ public Error() { } /// /// Initializes a new instance of the Error class. /// - public Error(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), string innerError = default(string)) + public Error(string code = default(string), string message = default(string), string target = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList), string innerError = default(string)) { Code = code; Message = message; @@ -37,27 +31,27 @@ public Error() { } /// /// - [JsonProperty(PropertyName = "code")] + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] public string Code { get; set; } /// /// - [JsonProperty(PropertyName = "message")] + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] public string Message { get; set; } /// /// - [JsonProperty(PropertyName = "target")] + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] public string Target { get; set; } /// /// - [JsonProperty(PropertyName = "details")] - public IList Details { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public System.Collections.Generic.IList Details { get; set; } /// /// - [JsonProperty(PropertyName = "innerError")] + [Newtonsoft.Json.JsonProperty(PropertyName = "innerError")] public string InnerError { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ErrorDetails.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ErrorDetails.cs index 79165ef59f48e..b54e805168343 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ErrorDetails.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ErrorDetails.cs @@ -2,19 +2,13 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; public partial class ErrorDetails { @@ -35,17 +29,17 @@ public ErrorDetails() { } /// /// - [JsonProperty(PropertyName = "code")] + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] public string Code { get; set; } /// /// - [JsonProperty(PropertyName = "target")] + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] public string Target { get; set; } /// /// - [JsonProperty(PropertyName = "message")] + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] public string Message { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuit.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuit.cs index 381f65b133512..cfcdf409d7d5c 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuit.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuit.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// /// ExpressRouteCircuit resource /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ExpressRouteCircuit : Resource { /// @@ -30,7 +24,35 @@ public ExpressRouteCircuit() { } /// /// Initializes a new instance of the ExpressRouteCircuit class. /// - public ExpressRouteCircuit(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExpressRouteCircuitSku sku = default(ExpressRouteCircuitSku), bool? allowClassicOperations = default(bool?), string circuitProvisioningState = default(string), string serviceProviderProvisioningState = default(string), IList authorizations = default(IList), IList peerings = default(IList), string serviceKey = default(string), string serviceProviderNotes = default(string), ExpressRouteCircuitServiceProviderProperties serviceProviderProperties = default(ExpressRouteCircuitServiceProviderProperties), string provisioningState = default(string), string gatewayManagerEtag = default(string), string etag = default(string)) + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// The SKU. + /// Allow classic + /// operations + /// The + /// CircuitProvisioningState state of the resource. + /// The + /// ServiceProviderProvisioningState state of the resource. Possible + /// values are 'NotProvisioned', 'Provisioning', 'Provisioned', and + /// 'Deprovisioning'. Possible values include: 'NotProvisioned', + /// 'Provisioning', 'Provisioned', 'Deprovisioning' + /// The list of authorizations. + /// The list of peerings. + /// The ServiceKey. + /// The + /// ServiceProviderNotes. + /// The + /// ServiceProviderProperties. + /// Gets the provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// The GatewayManager Etag. + /// Gets a unique read-only string that changes + /// whenever the resource is updated. + public ExpressRouteCircuit(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ExpressRouteCircuitSku sku = default(ExpressRouteCircuitSku), bool? allowClassicOperations = default(bool?), string circuitProvisioningState = default(string), string serviceProviderProvisioningState = default(string), System.Collections.Generic.IList authorizations = default(System.Collections.Generic.IList), System.Collections.Generic.IList peerings = default(System.Collections.Generic.IList), string serviceKey = default(string), string serviceProviderNotes = default(string), ExpressRouteCircuitServiceProviderProperties serviceProviderProperties = default(ExpressRouteCircuitServiceProviderProperties), string provisioningState = default(string), string gatewayManagerEtag = default(string), string etag = default(string)) : base(id, name, type, location, tags) { Sku = sku; @@ -48,79 +70,80 @@ public ExpressRouteCircuit() { } } /// - /// Gets or sets sku + /// Gets or sets the SKU. /// - [JsonProperty(PropertyName = "sku")] + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] public ExpressRouteCircuitSku Sku { get; set; } /// - /// allow classic operations + /// Gets or sets allow classic operations /// - [JsonProperty(PropertyName = "properties.allowClassicOperations")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowClassicOperations")] public bool? AllowClassicOperations { get; set; } /// - /// Gets or sets CircuitProvisioningState state of the resource + /// Gets or sets the CircuitProvisioningState state of the resource. /// - [JsonProperty(PropertyName = "properties.circuitProvisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.circuitProvisioningState")] public string CircuitProvisioningState { get; set; } /// - /// Gets or sets ServiceProviderProvisioningState state of the - /// resource . Possible values include: 'NotProvisioned', - /// 'Provisioning', 'Provisioned', 'Deprovisioning' + /// Gets or sets the ServiceProviderProvisioningState state of the + /// resource. Possible values are 'NotProvisioned', 'Provisioning', + /// 'Provisioned', and 'Deprovisioning'. Possible values include: + /// 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' /// - [JsonProperty(PropertyName = "properties.serviceProviderProvisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceProviderProvisioningState")] public string ServiceProviderProvisioningState { get; set; } /// - /// Gets or sets list of authorizations + /// Gets or sets the list of authorizations. /// - [JsonProperty(PropertyName = "properties.authorizations")] - public IList Authorizations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authorizations")] + public System.Collections.Generic.IList Authorizations { get; set; } /// - /// Gets or sets list of peerings + /// Gets or sets the list of peerings. /// - [JsonProperty(PropertyName = "properties.peerings")] - public IList Peerings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peerings")] + public System.Collections.Generic.IList Peerings { get; set; } /// - /// Gets or sets ServiceKey + /// Gets or sets the ServiceKey. /// - [JsonProperty(PropertyName = "properties.serviceKey")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceKey")] public string ServiceKey { get; set; } /// - /// Gets or sets ServiceProviderNotes + /// Gets or sets the ServiceProviderNotes. /// - [JsonProperty(PropertyName = "properties.serviceProviderNotes")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceProviderNotes")] public string ServiceProviderNotes { get; set; } /// - /// Gets or sets ServiceProviderProperties + /// Gets or sets the ServiceProviderProperties. /// - [JsonProperty(PropertyName = "properties.serviceProviderProperties")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceProviderProperties")] public ExpressRouteCircuitServiceProviderProperties ServiceProviderProperties { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the public IP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets or sets the GatewayManager Etag + /// Gets or sets the GatewayManager Etag. /// - [JsonProperty(PropertyName = "properties.gatewayManagerEtag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayManagerEtag")] public string GatewayManagerEtag { get; set; } /// /// Gets a unique read-only string that changes whenever the resource - /// is updated + /// is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitArpTable.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitArpTable.cs index 359df6d5d4009..f2396d042f69a 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitArpTable.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitArpTable.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// The arp table associated with the ExpressRouteCircuit + /// The ARP table associated with the ExpressRouteCircuit. /// public partial class ExpressRouteCircuitArpTable { @@ -31,6 +25,10 @@ public ExpressRouteCircuitArpTable() { } /// Initializes a new instance of the ExpressRouteCircuitArpTable /// class. /// + /// Age + /// Interface + /// The IP address. + /// The MAC address. public ExpressRouteCircuitArpTable(int? age = default(int?), string interfaceProperty = default(string), string ipAddress = default(string), string macAddress = default(string)) { Age = age; @@ -40,27 +38,27 @@ public ExpressRouteCircuitArpTable() { } } /// - /// Age. + /// Gets or sets age /// - [JsonProperty(PropertyName = "age")] + [Newtonsoft.Json.JsonProperty(PropertyName = "age")] public int? Age { get; set; } /// - /// Interface. + /// Gets or sets interface /// - [JsonProperty(PropertyName = "interface")] + [Newtonsoft.Json.JsonProperty(PropertyName = "interface")] public string InterfaceProperty { get; set; } /// - /// Gets ipAddress. + /// Gets or sets the IP address. /// - [JsonProperty(PropertyName = "ipAddress")] + [Newtonsoft.Json.JsonProperty(PropertyName = "ipAddress")] public string IpAddress { get; set; } /// - /// Gets macAddress. + /// Gets or sets the MAC address. /// - [JsonProperty(PropertyName = "macAddress")] + [Newtonsoft.Json.JsonProperty(PropertyName = "macAddress")] public string MacAddress { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitAuthorization.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitAuthorization.cs index 4ac09862d7a46..07c4e43b03693 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitAuthorization.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitAuthorization.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Authorization in a ExpressRouteCircuit resource + /// Authorization in an ExpressRouteCircuit resource. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ExpressRouteCircuitAuthorization : SubResource { /// @@ -32,6 +26,19 @@ public ExpressRouteCircuitAuthorization() { } /// Initializes a new instance of the ExpressRouteCircuitAuthorization /// class. /// + /// Resource ID. + /// The authorization key. + /// AuthorizationUseStatus. + /// Possible values are: 'Available' and 'InUse'. Possible values + /// include: 'Available', 'InUse' + /// Gets the provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// Gets name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ExpressRouteCircuitAuthorization(string id = default(string), string authorizationKey = default(string), string authorizationUseStatus = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -43,37 +50,38 @@ public ExpressRouteCircuitAuthorization() { } } /// - /// Gets or sets the authorization key + /// Gets or sets the authorization key. /// - [JsonProperty(PropertyName = "properties.authorizationKey")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authorizationKey")] public string AuthorizationKey { get; set; } /// - /// Gets or sets AuthorizationUseStatus. Possible values include: - /// 'Available', 'InUse' + /// Gets or sets authorizationUseStatus. Possible values are: + /// 'Available' and 'InUse'. Possible values include: 'Available', + /// 'InUse' /// - [JsonProperty(PropertyName = "properties.authorizationUseStatus")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authorizationUseStatus")] public string AuthorizationUseStatus { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the public IP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeering.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeering.cs index 59a0272b64c82..308531ca95e70 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeering.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeering.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Peering in a ExpressRouteCircuit resource + /// Peering in an ExpressRouteCircuit resource. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ExpressRouteCircuitPeering : SubResource { /// @@ -30,6 +24,39 @@ public ExpressRouteCircuitPeering() { } /// /// Initializes a new instance of the ExpressRouteCircuitPeering class. /// + /// Resource ID. + /// The PeeringType. Possible values are: + /// 'AzurePublicPeering', 'AzurePrivatePeering', and + /// 'MicrosoftPeering'. Possible values include: + /// 'AzurePublicPeering', 'AzurePrivatePeering', + /// 'MicrosoftPeering' + /// The state of peering. Possible values are: + /// 'Disabled' and 'Enbaled'. Possible values include: 'Disabled', + /// 'Enabled' + /// The Azure ASN. + /// The peer ASN. + /// The primary address + /// prefix. + /// The secondary address + /// prefix. + /// The primary port. + /// The secondary port. + /// The shared key. + /// The VLAN ID. + /// The Microsoft peering + /// configuration. + /// Gets peering stats. + /// Gets the provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// The GatewayManager Etag. + /// Gets whether the provider or the + /// customer last modified the peering. + /// Gets name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ExpressRouteCircuitPeering(string id = default(string), string peeringType = default(string), string state = default(string), int? azureASN = default(int?), int? peerASN = default(int?), string primaryPeerAddressPrefix = default(string), string secondaryPeerAddressPrefix = default(string), string primaryAzurePort = default(string), string secondaryAzurePort = default(string), string sharedKey = default(string), int? vlanId = default(int?), ExpressRouteCircuitPeeringConfig microsoftPeeringConfig = default(ExpressRouteCircuitPeeringConfig), ExpressRouteCircuitStats stats = default(ExpressRouteCircuitStats), string provisioningState = default(string), string gatewayManagerEtag = default(string), string lastModifiedBy = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -53,110 +80,113 @@ public ExpressRouteCircuitPeering() { } } /// - /// Gets or sets PeeringType. Possible values include: + /// Gets or sets the PeeringType. Possible values are: + /// 'AzurePublicPeering', 'AzurePrivatePeering', and + /// 'MicrosoftPeering'. Possible values include: /// 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' /// - [JsonProperty(PropertyName = "properties.peeringType")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peeringType")] public string PeeringType { get; set; } /// - /// Gets or sets state of Peering. Possible values include: - /// 'Disabled', 'Enabled' + /// Gets or sets the state of peering. Possible values are: 'Disabled' + /// and 'Enbaled'. Possible values include: 'Disabled', 'Enabled' /// - [JsonProperty(PropertyName = "properties.state")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.state")] public string State { get; set; } /// - /// Gets or sets the azure ASN + /// Gets or sets the Azure ASN. /// - [JsonProperty(PropertyName = "properties.azureASN")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.azureASN")] public int? AzureASN { get; set; } /// - /// Gets or sets the peer ASN + /// Gets or sets the peer ASN. /// - [JsonProperty(PropertyName = "properties.peerASN")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peerASN")] public int? PeerASN { get; set; } /// - /// Gets or sets the primary address prefix + /// Gets or sets the primary address prefix. /// - [JsonProperty(PropertyName = "properties.primaryPeerAddressPrefix")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primaryPeerAddressPrefix")] public string PrimaryPeerAddressPrefix { get; set; } /// - /// Gets or sets the secondary address prefix + /// Gets or sets the secondary address prefix. /// - [JsonProperty(PropertyName = "properties.secondaryPeerAddressPrefix")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.secondaryPeerAddressPrefix")] public string SecondaryPeerAddressPrefix { get; set; } /// - /// Gets or sets the primary port + /// Gets or sets the primary port. /// - [JsonProperty(PropertyName = "properties.primaryAzurePort")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primaryAzurePort")] public string PrimaryAzurePort { get; set; } /// - /// Gets or sets the secondary port + /// Gets or sets the secondary port. /// - [JsonProperty(PropertyName = "properties.secondaryAzurePort")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.secondaryAzurePort")] public string SecondaryAzurePort { get; set; } /// - /// Gets or sets the shared key + /// Gets or sets the shared key. /// - [JsonProperty(PropertyName = "properties.sharedKey")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sharedKey")] public string SharedKey { get; set; } /// - /// Gets or sets the vlan id + /// Gets or sets the VLAN ID. /// - [JsonProperty(PropertyName = "properties.vlanId")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vlanId")] public int? VlanId { get; set; } /// - /// Gets or sets the mircosoft peering config + /// Gets or sets the Microsoft peering configuration. /// - [JsonProperty(PropertyName = "properties.microsoftPeeringConfig")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.microsoftPeeringConfig")] public ExpressRouteCircuitPeeringConfig MicrosoftPeeringConfig { get; set; } /// - /// Gets or peering stats + /// Gets peering stats. /// - [JsonProperty(PropertyName = "properties.stats")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.stats")] public ExpressRouteCircuitStats Stats { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the public IP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets or sets the GatewayManager Etag + /// Gets or sets the GatewayManager Etag. /// - [JsonProperty(PropertyName = "properties.gatewayManagerEtag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayManagerEtag")] public string GatewayManagerEtag { get; set; } /// - /// Gets whether the provider or the customer last modified the peering + /// Gets whether the provider or the customer last modified the + /// peering. /// - [JsonProperty(PropertyName = "properties.lastModifiedBy")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.lastModifiedBy")] public string LastModifiedBy { get; set; } /// /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.cs index 8b35c3dc882f6..0814213900ddf 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringConfig.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringConfig.cs index c05cc3d2675cd..9e12cf1fafe97 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringConfig.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringConfig.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Specifies the peering config + /// Specifies the peering configuration. /// public partial class ExpressRouteCircuitPeeringConfig { @@ -31,7 +25,18 @@ public ExpressRouteCircuitPeeringConfig() { } /// Initializes a new instance of the ExpressRouteCircuitPeeringConfig /// class. /// - public ExpressRouteCircuitPeeringConfig(IList advertisedPublicPrefixes = default(IList), string advertisedPublicPrefixesState = default(string), int? customerASN = default(int?), string routingRegistryName = default(string)) + /// The reference of + /// AdvertisedPublicPrefixes. + /// AdvertisedPublicPrefixState + /// of the Peering resource. Possible values are 'NotConfigured', + /// 'Configuring', 'Configured', and 'ValidationNeeded'. Possible + /// values include: 'NotConfigured', 'Configuring', 'Configured', + /// 'ValidationNeeded' + /// The CustomerASN of the peering. + /// The RoutingRegistryName of the + /// configuration. + public ExpressRouteCircuitPeeringConfig(System.Collections.Generic.IList advertisedPublicPrefixes = default(System.Collections.Generic.IList), string advertisedPublicPrefixesState = default(string), int? customerASN = default(int?), string routingRegistryName = default(string)) { AdvertisedPublicPrefixes = advertisedPublicPrefixes; AdvertisedPublicPrefixesState = advertisedPublicPrefixesState; @@ -40,29 +45,30 @@ public ExpressRouteCircuitPeeringConfig() { } } /// - /// Gets or sets the reference of AdvertisedPublicPrefixes + /// Gets or sets the reference of AdvertisedPublicPrefixes. /// - [JsonProperty(PropertyName = "advertisedPublicPrefixes")] - public IList AdvertisedPublicPrefixes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "advertisedPublicPrefixes")] + public System.Collections.Generic.IList AdvertisedPublicPrefixes { get; set; } /// - /// Gets or sets AdvertisedPublicPrefixState of the Peering resource . - /// Possible values include: 'NotConfigured', 'Configuring', - /// 'Configured', 'ValidationNeeded' + /// Gets or sets advertisedPublicPrefixState of the Peering resource. + /// Possible values are 'NotConfigured', 'Configuring', 'Configured', + /// and 'ValidationNeeded'. Possible values include: 'NotConfigured', + /// 'Configuring', 'Configured', 'ValidationNeeded' /// - [JsonProperty(PropertyName = "advertisedPublicPrefixesState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "advertisedPublicPrefixesState")] public string AdvertisedPublicPrefixesState { get; set; } /// - /// Gets or Sets CustomerAsn of the peering. + /// Gets or sets the CustomerASN of the peering. /// - [JsonProperty(PropertyName = "customerASN")] + [Newtonsoft.Json.JsonProperty(PropertyName = "customerASN")] public int? CustomerASN { get; set; } /// - /// Gets or Sets RoutingRegistryName of the config. + /// Gets or sets the RoutingRegistryName of the configuration. /// - [JsonProperty(PropertyName = "routingRegistryName")] + [Newtonsoft.Json.JsonProperty(PropertyName = "routingRegistryName")] public string RoutingRegistryName { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringState.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringState.cs index 6f8c1d2047f31..aaa83a36de6bb 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringState.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringState.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for ExpressRouteCircuitPeeringState. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringType.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringType.cs index baac3d9ffb392..1fd205803da3a 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringType.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringType.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for ExpressRouteCircuitPeeringType. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTable.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTable.cs index 83f6f8ab343c1..c098df1980188 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTable.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTable.cs @@ -2,19 +2,13 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// /// The routes table associated with the ExpressRouteCircuit @@ -31,6 +25,11 @@ public ExpressRouteCircuitRoutesTable() { } /// Initializes a new instance of the ExpressRouteCircuitRoutesTable /// class. /// + /// network + /// nextHop + /// locPrf + /// weight. + /// path public ExpressRouteCircuitRoutesTable(string network = default(string), string nextHop = default(string), string locPrf = default(string), int? weight = default(int?), string path = default(string)) { Network = network; @@ -41,33 +40,33 @@ public ExpressRouteCircuitRoutesTable() { } } /// - /// network. + /// Gets or sets network /// - [JsonProperty(PropertyName = "network")] + [Newtonsoft.Json.JsonProperty(PropertyName = "network")] public string Network { get; set; } /// - /// nextHop + /// Gets or sets nextHop /// - [JsonProperty(PropertyName = "nextHop")] + [Newtonsoft.Json.JsonProperty(PropertyName = "nextHop")] public string NextHop { get; set; } /// - /// locPrf. + /// Gets or sets locPrf /// - [JsonProperty(PropertyName = "locPrf")] + [Newtonsoft.Json.JsonProperty(PropertyName = "locPrf")] public string LocPrf { get; set; } /// - /// weight. + /// Gets or sets weight. /// - [JsonProperty(PropertyName = "weight")] + [Newtonsoft.Json.JsonProperty(PropertyName = "weight")] public int? Weight { get; set; } /// - /// path . + /// Gets or sets path /// - [JsonProperty(PropertyName = "path")] + [Newtonsoft.Json.JsonProperty(PropertyName = "path")] public string Path { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTableSummary.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTableSummary.cs index 03256243a9c3c..339391a019fd5 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTableSummary.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTableSummary.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// The routes table associated with the ExpressRouteCircuit + /// The routes table associated with the ExpressRouteCircuit. /// public partial class ExpressRouteCircuitRoutesTableSummary { @@ -31,6 +25,15 @@ public ExpressRouteCircuitRoutesTableSummary() { } /// Initializes a new instance of the /// ExpressRouteCircuitRoutesTableSummary class. /// + /// Neighbor + /// BGP version number spoken to the neighbor. + /// Autonomous system number. + /// The length of time that the BGP session has + /// been in the Established state, or the current status if not in + /// the Established state. + /// Current state of the BGP session, and + /// the number of prefixes that have been received from a neighbor or + /// peer group. public ExpressRouteCircuitRoutesTableSummary(string neighbor = default(string), int? v = default(int?), int? asProperty = default(int?), string upDown = default(string), string statePfxRcd = default(string)) { Neighbor = neighbor; @@ -41,36 +44,36 @@ public ExpressRouteCircuitRoutesTableSummary() { } } /// - /// Neighbor. + /// Gets or sets neighbor /// - [JsonProperty(PropertyName = "neighbor")] + [Newtonsoft.Json.JsonProperty(PropertyName = "neighbor")] public string Neighbor { get; set; } /// - /// BGP version number spoken to the neighbor. + /// Gets or sets BGP version number spoken to the neighbor. /// - [JsonProperty(PropertyName = "v")] + [Newtonsoft.Json.JsonProperty(PropertyName = "v")] public int? V { get; set; } /// - /// Autonomous system number. + /// Gets or sets autonomous system number. /// - [JsonProperty(PropertyName = "as")] + [Newtonsoft.Json.JsonProperty(PropertyName = "as")] public int? AsProperty { get; set; } /// - /// The length of time that the BGP session has been in the - /// Established state, or the current status if not in the + /// Gets or sets the length of time that the BGP session has been in + /// the Established state, or the current status if not in the /// Established state. /// - [JsonProperty(PropertyName = "upDown")] + [Newtonsoft.Json.JsonProperty(PropertyName = "upDown")] public string UpDown { get; set; } /// - /// Current state of the BGP session, and the number of prefixes that - /// have been received from a neighbor or peer group. + /// Gets or sets current state of the BGP session, and the number of + /// prefixes that have been received from a neighbor or peer group. /// - [JsonProperty(PropertyName = "statePfxRcd")] + [Newtonsoft.Json.JsonProperty(PropertyName = "statePfxRcd")] public string StatePfxRcd { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitServiceProviderProperties.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitServiceProviderProperties.cs index 2a20f0d26d396..5fefca6a5d149 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitServiceProviderProperties.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitServiceProviderProperties.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Contains ServiceProviderProperties in an ExpressRouteCircuit + /// Contains ServiceProviderProperties in an ExpressRouteCircuit. /// public partial class ExpressRouteCircuitServiceProviderProperties { @@ -31,6 +25,9 @@ public ExpressRouteCircuitServiceProviderProperties() { } /// Initializes a new instance of the /// ExpressRouteCircuitServiceProviderProperties class. /// + /// The serviceProviderName. + /// The peering location. + /// The BandwidthInMbps. public ExpressRouteCircuitServiceProviderProperties(string serviceProviderName = default(string), string peeringLocation = default(string), int? bandwidthInMbps = default(int?)) { ServiceProviderName = serviceProviderName; @@ -39,21 +36,21 @@ public ExpressRouteCircuitServiceProviderProperties() { } } /// - /// Gets or sets serviceProviderName. + /// Gets or sets the serviceProviderName. /// - [JsonProperty(PropertyName = "serviceProviderName")] + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceProviderName")] public string ServiceProviderName { get; set; } /// - /// Gets or sets peering location. + /// Gets or sets the peering location. /// - [JsonProperty(PropertyName = "peeringLocation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "peeringLocation")] public string PeeringLocation { get; set; } /// - /// Gets or sets BandwidthInMbps. + /// Gets or sets the BandwidthInMbps. /// - [JsonProperty(PropertyName = "bandwidthInMbps")] + [Newtonsoft.Json.JsonProperty(PropertyName = "bandwidthInMbps")] public int? BandwidthInMbps { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSku.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSku.cs index 02a90ea17e45a..1a626cda0291b 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSku.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSku.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Contains sku in an ExpressRouteCircuit + /// Contains SKU in an ExpressRouteCircuit. /// public partial class ExpressRouteCircuitSku { @@ -29,6 +23,13 @@ public ExpressRouteCircuitSku() { } /// /// Initializes a new instance of the ExpressRouteCircuitSku class. /// + /// The name of the SKU. + /// The tier of the SKU. Possible values are + /// 'Standard' and 'Premium'. Possible values include: 'Standard', + /// 'Premium' + /// The family of the SKU. Possible values are: + /// 'UnlimitedData' and 'MeteredData'. Possible values include: + /// 'UnlimitedData', 'MeteredData' public ExpressRouteCircuitSku(string name = default(string), string tier = default(string), string family = default(string)) { Name = name; @@ -37,23 +38,24 @@ public ExpressRouteCircuitSku() { } } /// - /// Gets or sets name of the sku. + /// Gets or sets the name of the SKU. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// Gets or sets tier of the sku. Possible values include: 'Standard', - /// 'Premium' + /// Gets or sets the tier of the SKU. Possible values are 'Standard' + /// and 'Premium'. Possible values include: 'Standard', 'Premium' /// - [JsonProperty(PropertyName = "tier")] + [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] public string Tier { get; set; } /// - /// Gets or sets family of the sku. Possible values include: + /// Gets or sets the family of the SKU. Possible values are: + /// 'UnlimitedData' and 'MeteredData'. Possible values include: /// 'UnlimitedData', 'MeteredData' /// - [JsonProperty(PropertyName = "family")] + [Newtonsoft.Json.JsonProperty(PropertyName = "family")] public string Family { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuFamily.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuFamily.cs index d5d7f2f3da506..2d76ac674a067 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuFamily.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuFamily.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for ExpressRouteCircuitSkuFamily. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuTier.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuTier.cs index a77ddcf7863dc..0c32ebcf3ddf9 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuTier.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuTier.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for ExpressRouteCircuitSkuTier. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitStats.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitStats.cs index 0df96d3e5863d..b727de0d17368 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitStats.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitStats.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Contains Stats associated with the peering + /// Contains stats associated with the peering. /// public partial class ExpressRouteCircuitStats { @@ -29,6 +23,11 @@ public ExpressRouteCircuitStats() { } /// /// Initializes a new instance of the ExpressRouteCircuitStats class. /// + /// Gets BytesIn of the peering. + /// Gets BytesOut of the peering. + /// Gets BytesIn of the peering. + /// Gets BytesOut of the + /// peering. public ExpressRouteCircuitStats(long? primarybytesIn = default(long?), long? primarybytesOut = default(long?), long? secondarybytesIn = default(long?), long? secondarybytesOut = default(long?)) { PrimarybytesIn = primarybytesIn; @@ -40,25 +39,25 @@ public ExpressRouteCircuitStats() { } /// /// Gets BytesIn of the peering. /// - [JsonProperty(PropertyName = "primarybytesIn")] + [Newtonsoft.Json.JsonProperty(PropertyName = "primarybytesIn")] public long? PrimarybytesIn { get; set; } /// /// Gets BytesOut of the peering. /// - [JsonProperty(PropertyName = "primarybytesOut")] + [Newtonsoft.Json.JsonProperty(PropertyName = "primarybytesOut")] public long? PrimarybytesOut { get; set; } /// /// Gets BytesIn of the peering. /// - [JsonProperty(PropertyName = "secondarybytesIn")] + [Newtonsoft.Json.JsonProperty(PropertyName = "secondarybytesIn")] public long? SecondarybytesIn { get; set; } /// /// Gets BytesOut of the peering. /// - [JsonProperty(PropertyName = "secondarybytesOut")] + [Newtonsoft.Json.JsonProperty(PropertyName = "secondarybytesOut")] public long? SecondarybytesOut { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsArpTableListResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsArpTableListResult.cs index 2660f612a16b6..3dd5e554d5214 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsArpTableListResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsArpTableListResult.cs @@ -2,23 +2,17 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// /// Response for ListArpTable associated with the Express Route Circuits - /// Api + /// API. /// public partial class ExpressRouteCircuitsArpTableListResult { @@ -32,22 +26,25 @@ public ExpressRouteCircuitsArpTableListResult() { } /// Initializes a new instance of the /// ExpressRouteCircuitsArpTableListResult class. /// - public ExpressRouteCircuitsArpTableListResult(IList value = default(IList), string nextLink = default(string)) + /// Gets list of the ARP table. + /// The URL to get the next set of + /// results. + public ExpressRouteCircuitsArpTableListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) { Value = value; NextLink = nextLink; } /// - /// Gets List of ArpTable + /// Gets list of the ARP table. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value { get; set; } /// - /// Gets the URL to get the next set of results. + /// Gets or sets the URL to get the next set of results. /// - [JsonProperty(PropertyName = "nextLink")] + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] public string NextLink { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableListResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableListResult.cs index 33c992071ef7d..299fe780d8781 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableListResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableListResult.cs @@ -2,23 +2,17 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// /// Response for ListRoutesTable associated with the Express Route - /// Circuits Api + /// Circuits API. /// public partial class ExpressRouteCircuitsRoutesTableListResult { @@ -32,22 +26,25 @@ public ExpressRouteCircuitsRoutesTableListResult() { } /// Initializes a new instance of the /// ExpressRouteCircuitsRoutesTableListResult class. /// - public ExpressRouteCircuitsRoutesTableListResult(IList value = default(IList), string nextLink = default(string)) + /// The list of routes table. + /// The URL to get the next set of + /// results. + public ExpressRouteCircuitsRoutesTableListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) { Value = value; NextLink = nextLink; } /// - /// Gets List of RoutesTable + /// Gets or sets the list of routes table. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value { get; set; } /// - /// Gets the URL to get the next set of results. + /// Gets or sets the URL to get the next set of results. /// - [JsonProperty(PropertyName = "nextLink")] + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] public string NextLink { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableSummaryListResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableSummaryListResult.cs index 3e04ebb317ecb..5d58ebe5a3b73 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableSummaryListResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableSummaryListResult.cs @@ -2,23 +2,17 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// /// Response for ListRoutesTable associated with the Express Route - /// Circuits Api + /// Circuits API. /// public partial class ExpressRouteCircuitsRoutesTableSummaryListResult { @@ -32,22 +26,25 @@ public ExpressRouteCircuitsRoutesTableSummaryListResult() { } /// Initializes a new instance of the /// ExpressRouteCircuitsRoutesTableSummaryListResult class. /// - public ExpressRouteCircuitsRoutesTableSummaryListResult(IList value = default(IList), string nextLink = default(string)) + /// A list of the routes table. + /// The URL to get the next set of + /// results. + public ExpressRouteCircuitsRoutesTableSummaryListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) { Value = value; NextLink = nextLink; } /// - /// Gets List of RoutesTable + /// Gets or sets a list of the routes table. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value { get; set; } /// - /// Gets the URL to get the next set of results. + /// Gets or sets the URL to get the next set of results. /// - [JsonProperty(PropertyName = "nextLink")] + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] public string NextLink { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProvider.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProvider.cs index 9dee4f989b124..ede85286d9498 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProvider.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProvider.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// ExpressRouteResourceProvider object + /// A ExpressRouteResourceProvider object. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ExpressRouteServiceProvider : Resource { /// @@ -32,7 +26,17 @@ public ExpressRouteServiceProvider() { } /// Initializes a new instance of the ExpressRouteServiceProvider /// class. /// - public ExpressRouteServiceProvider(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList peeringLocations = default(IList), IList bandwidthsOffered = default(IList), string provisioningState = default(string)) + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// Get a list of peering + /// locations. + /// Gets bandwidths offered. + /// Gets the provisioning state of the + /// resource. + public ExpressRouteServiceProvider(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList peeringLocations = default(System.Collections.Generic.IList), System.Collections.Generic.IList bandwidthsOffered = default(System.Collections.Generic.IList), string provisioningState = default(string)) : base(id, name, type, location, tags) { PeeringLocations = peeringLocations; @@ -41,21 +45,21 @@ public ExpressRouteServiceProvider() { } } /// - /// Gets or list of peering locations + /// Gets or sets get a list of peering locations. /// - [JsonProperty(PropertyName = "properties.peeringLocations")] - public IList PeeringLocations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peeringLocations")] + public System.Collections.Generic.IList PeeringLocations { get; set; } /// - /// Gets or bandwidths offered + /// Gets bandwidths offered. /// - [JsonProperty(PropertyName = "properties.bandwidthsOffered")] - public IList BandwidthsOffered { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bandwidthsOffered")] + public System.Collections.Generic.IList BandwidthsOffered { get; set; } /// - /// Gets provisioning state of the resource + /// Gets the provisioning state of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProviderBandwidthsOffered.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProviderBandwidthsOffered.cs index cf9b936fbcf60..aefa8e074442e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProviderBandwidthsOffered.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProviderBandwidthsOffered.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Contains Bandwidths offered in ExpressRouteServiceProviders + /// Contains bandwidths offered in ExpressRouteServiceProvider resources. /// public partial class ExpressRouteServiceProviderBandwidthsOffered { @@ -31,6 +25,8 @@ public ExpressRouteServiceProviderBandwidthsOffered() { } /// Initializes a new instance of the /// ExpressRouteServiceProviderBandwidthsOffered class. /// + /// The OfferName. + /// The ValueInMbps. public ExpressRouteServiceProviderBandwidthsOffered(string offerName = default(string), int? valueInMbps = default(int?)) { OfferName = offerName; @@ -38,15 +34,15 @@ public ExpressRouteServiceProviderBandwidthsOffered() { } } /// - /// Gets the OfferName + /// Gets or sets the OfferName. /// - [JsonProperty(PropertyName = "offerName")] + [Newtonsoft.Json.JsonProperty(PropertyName = "offerName")] public string OfferName { get; set; } /// - /// Gets the ValueInMbps. + /// Gets or sets the ValueInMbps. /// - [JsonProperty(PropertyName = "valueInMbps")] + [Newtonsoft.Json.JsonProperty(PropertyName = "valueInMbps")] public int? ValueInMbps { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/FrontendIpConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/FrontendIpConfiguration.cs index 992a650f63941..73f9b906b98c0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/FrontendIpConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/FrontendIpConfiguration.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Frontend IP address of the load balancer + /// Frontend IP address of the load balancer. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class FrontendIPConfiguration : SubResource { /// @@ -30,7 +24,32 @@ public FrontendIPConfiguration() { } /// /// Initializes a new instance of the FrontendIPConfiguration class. /// - public FrontendIPConfiguration(string id = default(string), IList inboundNatRules = default(IList), IList inboundNatPools = default(IList), IList outboundNatRules = default(IList), IList loadBalancingRules = default(IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), Subnet subnet = default(Subnet), PublicIPAddress publicIPAddress = default(PublicIPAddress), string provisioningState = default(string), string name = default(string), string etag = default(string)) + /// Resource ID. + /// Read only. Inbound rules URIs that + /// use this frontend IP. + /// Read only. Inbound pools URIs that + /// use this frontend IP. + /// Read only. Outbound rules URIs that + /// use this frontend IP. + /// Gets load balancing rules URIs + /// that use this frontend IP. + /// The private IP address of the IP + /// configuration. + /// The Private IP allocation + /// method. Possible values are: 'Static' and 'Dynamic'. Possible + /// values include: 'Static', 'Dynamic' + /// The reference of the subnet resource. + /// The reference of the Public IP + /// resource. + /// Gets the provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// The name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. + public FrontendIPConfiguration(string id = default(string), System.Collections.Generic.IList inboundNatRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList inboundNatPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList outboundNatRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancingRules = default(System.Collections.Generic.IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), Subnet subnet = default(Subnet), PublicIPAddress publicIPAddress = default(PublicIPAddress), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { InboundNatRules = inboundNatRules; @@ -47,73 +66,74 @@ public FrontendIPConfiguration() { } } /// - /// Read only. Inbound rules URIs that use this frontend IP + /// Gets read only. Inbound rules URIs that use this frontend IP. /// - [JsonProperty(PropertyName = "properties.inboundNatRules")] - public IList InboundNatRules { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.inboundNatRules")] + public System.Collections.Generic.IList InboundNatRules { get; private set; } /// - /// Read only. Inbound pools URIs that use this frontend IP + /// Gets read only. Inbound pools URIs that use this frontend IP. /// - [JsonProperty(PropertyName = "properties.inboundNatPools")] - public IList InboundNatPools { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.inboundNatPools")] + public System.Collections.Generic.IList InboundNatPools { get; private set; } /// - /// Read only. Outbound rules URIs that use this frontend IP + /// Gets read only. Outbound rules URIs that use this frontend IP. /// - [JsonProperty(PropertyName = "properties.outboundNatRules")] - public IList OutboundNatRules { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.outboundNatRules")] + public System.Collections.Generic.IList OutboundNatRules { get; private set; } /// - /// Gets Load Balancing rules URIs that use this frontend IP + /// Gets load balancing rules URIs that use this frontend IP. /// - [JsonProperty(PropertyName = "properties.loadBalancingRules")] - public IList LoadBalancingRules { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancingRules")] + public System.Collections.Generic.IList LoadBalancingRules { get; private set; } /// - /// Gets or sets the privateIPAddress of the IP Configuration + /// Gets or sets the private IP address of the IP configuration. /// - [JsonProperty(PropertyName = "properties.privateIPAddress")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddress")] public string PrivateIPAddress { get; set; } /// - /// Gets or sets PrivateIP allocation method. Possible values include: - /// 'Static', 'Dynamic' + /// Gets or sets the Private IP allocation method. Possible values + /// are: 'Static' and 'Dynamic'. Possible values include: 'Static', + /// 'Dynamic' /// - [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] public string PrivateIPAllocationMethod { get; set; } /// - /// Gets or sets the reference of the subnet resource + /// Gets or sets the reference of the subnet resource. /// - [JsonProperty(PropertyName = "properties.subnet")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] public Subnet Subnet { get; set; } /// - /// Gets or sets the reference of the PublicIP resource + /// Gets or sets the reference of the Public IP resource. /// - [JsonProperty(PropertyName = "properties.publicIPAddress")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddress")] public PublicIPAddress PublicIPAddress { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the public IP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPAddressAvailabilityResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPAddressAvailabilityResult.cs index d223939059995..497c794f358b5 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPAddressAvailabilityResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPAddressAvailabilityResult.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Response for CheckIPAddressAvailability Api service call + /// Response for CheckIPAddressAvailability API service call /// public partial class IPAddressAvailabilityResult { @@ -31,24 +25,27 @@ public IPAddressAvailabilityResult() { } /// Initializes a new instance of the IPAddressAvailabilityResult /// class. /// - public IPAddressAvailabilityResult(bool? available = default(bool?), IList availableIPAddresses = default(IList)) + /// Private IP address availability. + /// Contains other available + /// private IP addresses if the asked for address is taken. + public IPAddressAvailabilityResult(bool? available = default(bool?), System.Collections.Generic.IList availableIPAddresses = default(System.Collections.Generic.IList)) { Available = available; AvailableIPAddresses = availableIPAddresses; } /// - /// Private IP address availability + /// Gets or sets private IP address availability. /// - [JsonProperty(PropertyName = "available")] + [Newtonsoft.Json.JsonProperty(PropertyName = "available")] public bool? Available { get; set; } /// - /// Contains other available private IP addresses if the asked for - /// address is taken + /// Gets or sets contains other available private IP addresses if the + /// asked for address is taken. /// - [JsonProperty(PropertyName = "availableIPAddresses")] - public IList AvailableIPAddresses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "availableIPAddresses")] + public System.Collections.Generic.IList AvailableIPAddresses { get; set; } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPConfiguration.cs index abfc74fc76dc1..5bc56ffab53f6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPConfiguration.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// /// IPConfiguration /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class IPConfiguration : SubResource { /// @@ -30,6 +24,23 @@ public IPConfiguration() { } /// /// Initializes a new instance of the IPConfiguration class. /// + /// Resource ID. + /// The private IP address of the IP + /// configuration. + /// The private IP allocation + /// method. Possible values are 'Static' and 'Dynamic'. Possible + /// values include: 'Static', 'Dynamic' + /// The reference of the subnet resource. + /// The reference of the public IP + /// resource. + /// Gets the provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// The name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public IPConfiguration(string id = default(string), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), Subnet subnet = default(Subnet), PublicIPAddress publicIPAddress = default(PublicIPAddress), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -43,49 +54,50 @@ public IPConfiguration() { } } /// - /// Gets or sets the privateIPAddress of the IP Configuration + /// Gets or sets the private IP address of the IP configuration. /// - [JsonProperty(PropertyName = "properties.privateIPAddress")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddress")] public string PrivateIPAddress { get; set; } /// - /// Gets or sets PrivateIP allocation method. Possible values include: - /// 'Static', 'Dynamic' + /// Gets or sets the private IP allocation method. Possible values are + /// 'Static' and 'Dynamic'. Possible values include: 'Static', + /// 'Dynamic' /// - [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] public string PrivateIPAllocationMethod { get; set; } /// - /// Gets or sets the reference of the subnet resource + /// Gets or sets the reference of the subnet resource. /// - [JsonProperty(PropertyName = "properties.subnet")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] public Subnet Subnet { get; set; } /// - /// Gets or sets the reference of the PublicIP resource + /// Gets or sets the reference of the public IP resource. /// - [JsonProperty(PropertyName = "properties.publicIPAddress")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddress")] public PublicIPAddress PublicIPAddress { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the public IP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPVersion.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPVersion.cs index b10e14230d1bf..675411474f4b3 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPVersion.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPVersion.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for IPVersion. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatPool.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatPool.cs index a6710086ae4ad..b4f90e15e89a4 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatPool.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatPool.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Inbound NAT pool of the load balancer + /// Inbound NAT pool of the load balancer. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class InboundNatPool : SubResource { /// @@ -30,6 +24,31 @@ public InboundNatPool() { } /// /// Initializes a new instance of the InboundNatPool class. /// + /// The transport protocol for the endpoint. + /// Possible values are: 'Udp' or 'Tcp'. Possible values include: + /// 'Udp', 'Tcp' + /// The first port number in the + /// range of external ports that will be used to provide Inbound Nat + /// to NICs associated with a load balancer. Acceptable values range + /// between 1 and 65534. + /// The last port number in the + /// range of external ports that will be used to provide Inbound Nat + /// to NICs associated with a load balancer. Acceptable values range + /// between 1 and 65535. + /// The port used for internal connections + /// on the endpoint. Acceptable values are between 1 and + /// 65535. + /// Resource ID. + /// A reference to frontend IP + /// addresses. + /// Gets the provisioning state of the + /// PublicIP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// The name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public InboundNatPool(string protocol, int frontendPortRangeStart, int frontendPortRangeEnd, int backendPort, string id = default(string), SubResource frontendIPConfiguration = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -44,79 +63,73 @@ public InboundNatPool() { } } /// - /// Gets or sets a reference to frontend IP Addresses + /// Gets or sets a reference to frontend IP addresses. /// - [JsonProperty(PropertyName = "properties.frontendIPConfiguration")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfiguration")] public SubResource FrontendIPConfiguration { get; set; } /// /// Gets or sets the transport protocol for the endpoint. Possible - /// values are Udp or Tcp. Possible values include: 'Udp', 'Tcp' + /// values are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' /// - [JsonProperty(PropertyName = "properties.protocol")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// - /// Gets or sets the starting port range for the NAT pool. You can - /// specify any port number you choose, but the port numbers - /// specified for each role in the service must be unique. Possible - /// values range between 1 and 65535, inclusive + /// Gets or sets the first port number in the range of external ports + /// that will be used to provide Inbound Nat to NICs associated with + /// a load balancer. Acceptable values range between 1 and 65534. /// - [JsonProperty(PropertyName = "properties.frontendPortRangeStart")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPortRangeStart")] public int FrontendPortRangeStart { get; set; } /// - /// Gets or sets the ending port range for the NAT pool. You can - /// specify any port number you choose, but the port numbers - /// specified for each role in the service must be unique. Possible - /// values range between 1 and 65535, inclusive + /// Gets or sets the last port number in the range of external ports + /// that will be used to provide Inbound Nat to NICs associated with + /// a load balancer. Acceptable values range between 1 and 65535. /// - [JsonProperty(PropertyName = "properties.frontendPortRangeEnd")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPortRangeEnd")] public int FrontendPortRangeEnd { get; set; } /// - /// Gets or sets a port used for internal connections on the endpoint. - /// The localPort attribute maps the eternal port of the endpoint to - /// an internal port on a role. This is useful in scenarios where a - /// role must communicate to an internal component on a port that is - /// different from the one that is exposed externally. If not - /// specified, the value of localPort is the same as the port - /// attribute. Set the value of localPort to '*' to automatically - /// assign an unallocated port that is discoverable using the runtime - /// API + /// Gets or sets the port used for internal connections on the + /// endpoint. Acceptable values are between 1 and 65535. /// - [JsonProperty(PropertyName = "properties.backendPort")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendPort")] public int BackendPort { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the PublicIP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (Protocol == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Protocol"); } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatRule.cs index 5801e26994c58..75d2f0b50fcc2 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatRule.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Inbound NAT rule of the loadbalancer + /// Inbound NAT rule of the load balancer. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class InboundNatRule : SubResource { /// @@ -30,6 +24,38 @@ public InboundNatRule() { } /// /// Initializes a new instance of the InboundNatRule class. /// + /// Resource ID. + /// A reference to frontend IP + /// addresses. + /// A reference to a private IP + /// address defined on a network interface of a VM. Traffic sent to + /// the frontend port of each of the frontend IP configurations is + /// forwarded to the backed IP. + /// The transport protocol for the endpoint. + /// Possible values are: 'Udp' or 'Tcp'. Possible values include: + /// 'Udp', 'Tcp' + /// The port for the external endpoint. + /// Port numbers for each Rule must be unique within the Load + /// Balancer. Acceptable values range from 1 to 65534. + /// The port used for the internal endpoint. + /// Acceptable values range from 1 to 65535. + /// The timeout for the TCP idle + /// connection. The value can be set between 4 and 30 minutes. The + /// default value is 4 minutes. This element is only used when the + /// protocol is set to TCP. + /// Configures a virtual machine's + /// endpoint for the floating IP capability required to configure a + /// SQL AlwaysOn Availability Group. This setting is required when + /// using the SQL AlwaysOn Availability Groups in SQL server. This + /// setting can't be changed after you create the endpoint. + /// Gets the provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// Gets name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public InboundNatRule(string id = default(string), SubResource frontendIPConfiguration = default(SubResource), NetworkInterfaceIPConfiguration backendIPConfiguration = default(NetworkInterfaceIPConfiguration), string protocol = default(string), int? frontendPort = default(int?), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -46,86 +72,79 @@ public InboundNatRule() { } } /// - /// Gets or sets a reference to frontend IP Addresses + /// Gets or sets a reference to frontend IP addresses. /// - [JsonProperty(PropertyName = "properties.frontendIPConfiguration")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfiguration")] public SubResource FrontendIPConfiguration { get; set; } /// - /// Gets or sets a reference to a private ip address defined on a - /// NetworkInterface of a VM. Traffic sent to frontendPort of each of - /// the frontendIPConfigurations is forwarded to the backed IP + /// Gets a reference to a private IP address defined on a network + /// interface of a VM. Traffic sent to the frontend port of each of + /// the frontend IP configurations is forwarded to the backed IP. /// - [JsonProperty(PropertyName = "properties.backendIPConfiguration")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendIPConfiguration")] public NetworkInterfaceIPConfiguration BackendIPConfiguration { get; private set; } /// /// Gets or sets the transport protocol for the endpoint. Possible - /// values are Udp or Tcp. Possible values include: 'Udp', 'Tcp' + /// values are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' /// - [JsonProperty(PropertyName = "properties.protocol")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// - /// Gets or sets the port for the external endpoint. You can specify - /// any port number you choose, but the port numbers specified for - /// each role in the service must be unique. Possible values range - /// between 1 and 65535, inclusive + /// Gets or sets the port for the external endpoint. Port numbers for + /// each Rule must be unique within the Load Balancer. Acceptable + /// values range from 1 to 65534. /// - [JsonProperty(PropertyName = "properties.frontendPort")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPort")] public int? FrontendPort { get; set; } /// - /// Gets or sets a port used for internal connections on the endpoint. - /// The localPort attribute maps the eternal port of the endpoint to - /// an internal port on a role. This is useful in scenarios where a - /// role must communicate to an internal component on a port that is - /// different from the one that is exposed externally. If not - /// specified, the value of localPort is the same as the port - /// attribute. Set the value of localPort to '*' to automatically - /// assign an unallocated port that is discoverable using the runtime - /// API + /// Gets or sets the port used for the internal endpoint. Acceptable + /// values range from 1 to 65535. /// - [JsonProperty(PropertyName = "properties.backendPort")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendPort")] public int? BackendPort { get; set; } /// - /// Gets or sets the timeout for the Tcp idle connection. The value + /// Gets or sets the timeout for the TCP idle connection. The value /// can be set between 4 and 30 minutes. The default value is 4 - /// minutes. This element is only used when the protocol is set to Tcp + /// minutes. This element is only used when the protocol is set to + /// TCP. /// - [JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] public int? IdleTimeoutInMinutes { get; set; } /// - /// Configures a virtual machine's endpoint for the floating IP - /// capability required to configure a SQL AlwaysOn availability - /// Group. This setting is required when using the SQL Always ON - /// availability Groups in SQL server. This setting can't be changed - /// after you create the endpoint + /// Gets or sets configures a virtual machine's endpoint for the + /// floating IP capability required to configure a SQL AlwaysOn + /// Availability Group. This setting is required when using the SQL + /// AlwaysOn Availability Groups in SQL server. This setting can't be + /// changed after you create the endpoint. /// - [JsonProperty(PropertyName = "properties.enableFloatingIP")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableFloatingIP")] public bool? EnableFloatingIP { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the public IP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IpAllocationMethod.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IpAllocationMethod.cs index 22c9f0ea660bf..726112605c882 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IpAllocationMethod.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IpAllocationMethod.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for IPAllocationMethod. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancer.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancer.cs index a0bfcf917522b..68d600d4c8540 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancer.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancer.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// /// LoadBalancer resource /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class LoadBalancer : Resource { /// @@ -30,7 +24,45 @@ public LoadBalancer() { } /// /// Initializes a new instance of the LoadBalancer class. /// - public LoadBalancer(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList frontendIPConfigurations = default(IList), IList backendAddressPools = default(IList), IList loadBalancingRules = default(IList), IList probes = default(IList), IList inboundNatRules = default(IList), IList inboundNatPools = default(IList), IList outboundNatRules = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// Object representing the + /// frontend IPs to be used for the load balancer + /// Collection of backend address + /// pools used by a load balancer + /// Object collection representing + /// the load balancing rules Gets the provisioning + /// Collection of probe objects used in the load + /// balancer + /// Collection of inbound NAT Rules used + /// by a load balancer. Defining inbound NAT rules on your load + /// balancer is mutually exclusive with defining an inbound NAT pool. + /// Inbound NAT pools are referenced from virtual machine scale sets. + /// NICs that are associated with individual virtual machines cannot + /// reference an Inbound NAT pool. They have to reference individual + /// inbound NAT rules. + /// Defines an external port range for + /// inbound NAT to a single backend port on NICs associated with a + /// load balancer. Inbound NAT rules are created automatically for + /// each NIC associated with the Load Balancer using an external port + /// from this range. Defining an Inbound NAT pool on your Load + /// Balancer is mutually exclusive with defining inbound Nat rules. + /// Inbound NAT pools are referenced from virtual machine scale sets. + /// NICs that are associated with individual virtual machines cannot + /// reference an inbound NAT pool. They have to reference individual + /// inbound NAT rules. + /// The outbound NAT rules. + /// The resource GUID property of the load + /// balancer resource. + /// Gets the provisioning state of the + /// PublicIP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// A unique read-only string that changes whenever + /// the resource is updated. + public LoadBalancer(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList frontendIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancingRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList probes = default(System.Collections.Generic.IList), System.Collections.Generic.IList inboundNatRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList inboundNatPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList outboundNatRules = default(System.Collections.Generic.IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { FrontendIPConfigurations = frontendIPConfigurations; @@ -46,65 +78,84 @@ public LoadBalancer() { } } /// - /// Gets or sets frontend IP addresses of the load balancer + /// Gets or sets object representing the frontend IPs to be used for + /// the load balancer /// - [JsonProperty(PropertyName = "properties.frontendIPConfigurations")] - public IList FrontendIPConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfigurations")] + public System.Collections.Generic.IList FrontendIPConfigurations { get; set; } /// - /// Gets or sets Pools of backend IP addresses + /// Gets or sets collection of backend address pools used by a load + /// balancer /// - [JsonProperty(PropertyName = "properties.backendAddressPools")] - public IList BackendAddressPools { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPools")] + public System.Collections.Generic.IList BackendAddressPools { get; set; } /// - /// Gets or sets load balancing rules + /// Gets or sets object collection representing the load balancing + /// rules Gets the provisioning /// - [JsonProperty(PropertyName = "properties.loadBalancingRules")] - public IList LoadBalancingRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancingRules")] + public System.Collections.Generic.IList LoadBalancingRules { get; set; } /// - /// Gets or sets list of Load balancer probes + /// Gets or sets collection of probe objects used in the load balancer /// - [JsonProperty(PropertyName = "properties.probes")] - public IList Probes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.probes")] + public System.Collections.Generic.IList Probes { get; set; } /// - /// Gets or sets list of inbound rules + /// Gets or sets collection of inbound NAT Rules used by a load + /// balancer. Defining inbound NAT rules on your load balancer is + /// mutually exclusive with defining an inbound NAT pool. Inbound NAT + /// pools are referenced from virtual machine scale sets. NICs that + /// are associated with individual virtual machines cannot reference + /// an Inbound NAT pool. They have to reference individual inbound + /// NAT rules. /// - [JsonProperty(PropertyName = "properties.inboundNatRules")] - public IList InboundNatRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.inboundNatRules")] + public System.Collections.Generic.IList InboundNatRules { get; set; } /// - /// Gets or sets inbound NAT pools + /// Gets or sets defines an external port range for inbound NAT to a + /// single backend port on NICs associated with a load balancer. + /// Inbound NAT rules are created automatically for each NIC + /// associated with the Load Balancer using an external port from + /// this range. Defining an Inbound NAT pool on your Load Balancer is + /// mutually exclusive with defining inbound Nat rules. Inbound NAT + /// pools are referenced from virtual machine scale sets. NICs that + /// are associated with individual virtual machines cannot reference + /// an inbound NAT pool. They have to reference individual inbound + /// NAT rules. /// - [JsonProperty(PropertyName = "properties.inboundNatPools")] - public IList InboundNatPools { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.inboundNatPools")] + public System.Collections.Generic.IList InboundNatPools { get; set; } /// - /// Gets or sets outbound NAT rules + /// Gets or sets the outbound NAT rules. /// - [JsonProperty(PropertyName = "properties.outboundNatRules")] - public IList OutboundNatRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.outboundNatRules")] + public System.Collections.Generic.IList OutboundNatRules { get; set; } /// - /// Gets or sets resource guid property of the Load balancer resource + /// Gets or sets the resource GUID property of the load balancer + /// resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the PublicIP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancingRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancingRule.cs index ac324b11c1911..d2142963b455f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancingRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancingRule.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Rules of the load balancer + /// A loag balancing rule for a load balancer. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class LoadBalancingRule : SubResource { /// @@ -30,6 +24,44 @@ public LoadBalancingRule() { } /// /// Initializes a new instance of the LoadBalancingRule class. /// + /// The transport protocol for the external + /// endpoint. Possible values are 'Udp' or 'Tcp'. Possible values + /// include: 'Udp', 'Tcp' + /// The port for the external endpoint. + /// Port numbers for each Rule must be unique within the Load + /// Balancer. Acceptable values are between 1 and 65534. + /// Resource ID. + /// A reference to frontend IP + /// addresses. + /// A reference to a pool of DIPs. + /// Inbound traffic is randomly load balanced across IPs in the + /// backend IPs. + /// The reference of the load balancer probe used + /// by the load balancing rule. + /// The load distribution policy for + /// this rule. Possible values are 'Default', 'SourceIP', and + /// 'SourceIPProtocol'. Possible values include: 'Default', + /// 'SourceIP', 'SourceIPProtocol' + /// The port used for internal connections + /// on the endpoint. Acceptable values are between 1 and 65535. + /// + /// The timeout for the TCP idle + /// connection. The value can be set between 4 and 30 minutes. The + /// default value is 4 minutes. This element is only used when the + /// protocol is set to TCP. + /// Configures a virtual machine's + /// endpoint for the floating IP capability required to configure a + /// SQL AlwaysOn Availability Group. This setting is required when + /// using the SQL AlwaysOn Availability Groups in SQL server. This + /// setting can't be changed after you create the endpoint. + /// Gets the provisioning state of the + /// PublicIP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// The name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public LoadBalancingRule(string protocol, int frontendPort, string id = default(string), SubResource frontendIPConfiguration = default(SubResource), SubResource backendAddressPool = default(SubResource), SubResource probe = default(SubResource), string loadDistribution = default(string), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -48,110 +80,107 @@ public LoadBalancingRule() { } } /// - /// Gets or sets a reference to frontend IP Addresses + /// Gets or sets a reference to frontend IP addresses. /// - [JsonProperty(PropertyName = "properties.frontendIPConfiguration")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfiguration")] public SubResource FrontendIPConfiguration { get; set; } /// - /// Gets or sets a reference to a pool of DIPs. Inbound traffic is - /// randomly load balanced across IPs in the backend IPs + /// Gets or sets a reference to a pool of DIPs. Inbound traffic is + /// randomly load balanced across IPs in the backend IPs. /// - [JsonProperty(PropertyName = "properties.backendAddressPool")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPool")] public SubResource BackendAddressPool { get; set; } /// /// Gets or sets the reference of the load balancer probe used by the - /// Load Balancing rule. + /// load balancing rule. /// - [JsonProperty(PropertyName = "properties.probe")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.probe")] public SubResource Probe { get; set; } /// /// Gets or sets the transport protocol for the external endpoint. - /// Possible values are Udp or Tcp. Possible values include: 'Udp', - /// 'Tcp' + /// Possible values are 'Udp' or 'Tcp'. Possible values include: + /// 'Udp', 'Tcp' /// - [JsonProperty(PropertyName = "properties.protocol")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// /// Gets or sets the load distribution policy for this rule. Possible - /// values include: 'Default', 'SourceIP', 'SourceIPProtocol' + /// values are 'Default', 'SourceIP', and 'SourceIPProtocol'. + /// Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' /// - [JsonProperty(PropertyName = "properties.loadDistribution")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadDistribution")] public string LoadDistribution { get; set; } /// - /// Gets or sets the port for the external endpoint. You can specify - /// any port number you choose, but the port numbers specified for - /// each role in the service must be unique. Possible values range - /// between 1 and 65535, inclusive + /// Gets or sets the port for the external endpoint. Port numbers for + /// each Rule must be unique within the Load Balancer. Acceptable + /// values are between 1 and 65534. /// - [JsonProperty(PropertyName = "properties.frontendPort")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPort")] public int FrontendPort { get; set; } /// - /// Gets or sets a port used for internal connections on the endpoint. - /// The localPort attribute maps the eternal port of the endpoint to - /// an internal port on a role. This is useful in scenarios where a - /// role must communicate to an internal component on a port that is - /// different from the one that is exposed externally. If not - /// specified, the value of localPort is the same as the port - /// attribute. Set the value of localPort to '*' to automatically - /// assign an unallocated port that is discoverable using the runtime - /// API + /// Gets or sets the port used for internal connections on the + /// endpoint. Acceptable values are between 1 and 65535. /// - [JsonProperty(PropertyName = "properties.backendPort")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendPort")] public int? BackendPort { get; set; } /// - /// Gets or sets the timeout for the Tcp idle connection. The value + /// Gets or sets the timeout for the TCP idle connection. The value /// can be set between 4 and 30 minutes. The default value is 4 - /// minutes. This element is only used when the protocol is set to Tcp + /// minutes. This element is only used when the protocol is set to + /// TCP. /// - [JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] public int? IdleTimeoutInMinutes { get; set; } /// - /// Configures a virtual machine's endpoint for the floating IP - /// capability required to configure a SQL AlwaysOn availability - /// Group. This setting is required when using the SQL Always ON - /// availability Groups in SQL server. This setting can't be changed - /// after you create the endpoint + /// Gets or sets configures a virtual machine's endpoint for the + /// floating IP capability required to configure a SQL AlwaysOn + /// Availability Group. This setting is required when using the SQL + /// AlwaysOn Availability Groups in SQL server. This setting can't be + /// changed after you create the endpoint. /// - [JsonProperty(PropertyName = "properties.enableFloatingIP")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableFloatingIP")] public bool? EnableFloatingIP { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the PublicIP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (Protocol == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Protocol"); } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadDistribution.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadDistribution.cs index dd75b710fa05c..625c462136ce2 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadDistribution.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadDistribution.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for LoadDistribution. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LocalNetworkGateway.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LocalNetworkGateway.cs index a2b8d3bdca8c5..75432186c4cb8 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LocalNetworkGateway.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LocalNetworkGateway.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// /// A common class for general resource information /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class LocalNetworkGateway : Resource { /// @@ -30,7 +24,25 @@ public LocalNetworkGateway() { } /// /// Initializes a new instance of the LocalNetworkGateway class. /// - public LocalNetworkGateway(AddressSpace localNetworkAddressSpace, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string gatewayIpAddress = default(string), BgpSettings bgpSettings = default(BgpSettings), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + /// Local network site address + /// space. + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// IP address of local network + /// gateway. + /// Local network gateway's BGP speaker + /// settings. + /// The resource GUID property of the + /// LocalNetworkGateway resource. + /// The provisioning state of the + /// LocalNetworkGateway resource. Possible values are: 'Updating', + /// 'Deleting', and 'Failed'. + /// A unique read-only string that changes whenever + /// the resource is updated. + public LocalNetworkGateway(AddressSpace localNetworkAddressSpace, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string gatewayIpAddress = default(string), BgpSettings bgpSettings = default(BgpSettings), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { LocalNetworkAddressSpace = localNetworkAddressSpace; @@ -42,52 +54,55 @@ public LocalNetworkGateway() { } } /// - /// Local network site Address space + /// Gets or sets local network site address space. /// - [JsonProperty(PropertyName = "properties.localNetworkAddressSpace")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.localNetworkAddressSpace")] public AddressSpace LocalNetworkAddressSpace { get; set; } /// - /// IP address of local network gateway. + /// Gets or sets IP address of local network gateway. /// - [JsonProperty(PropertyName = "properties.gatewayIpAddress")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayIpAddress")] public string GatewayIpAddress { get; set; } /// - /// Local network gateway's BGP speaker settings + /// Gets or sets local network gateway's BGP speaker settings. /// - [JsonProperty(PropertyName = "properties.bgpSettings")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bgpSettings")] public BgpSettings BgpSettings { get; set; } /// - /// Gets or sets resource guid property of the LocalNetworkGateway - /// resource + /// Gets or sets the resource GUID property of the LocalNetworkGateway + /// resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// - /// Gets provisioning state of the LocalNetworkGateway resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the LocalNetworkGateway resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (LocalNetworkAddressSpace == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "LocalNetworkAddressSpace"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "LocalNetworkAddressSpace"); } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterface.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterface.cs index 559b970694087..9866fc272e10d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterface.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterface.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// A NetworkInterface in a resource group + /// A network interface in a resource group. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class NetworkInterface : Resource { /// @@ -30,7 +24,35 @@ public NetworkInterface() { } /// /// Initializes a new instance of the NetworkInterface class. /// - public NetworkInterface(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SubResource virtualMachine = default(SubResource), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), IList ipConfigurations = default(IList), NetworkInterfaceDnsSettings dnsSettings = default(NetworkInterfaceDnsSettings), string macAddress = default(string), bool? primary = default(bool?), bool? enableAcceleratedNetworking = default(bool?), bool? enableIPForwarding = default(bool?), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// The reference of a virtual + /// machine. + /// The reference of the + /// NetworkSecurityGroup resource. + /// A list of IPConfigurations of the + /// network interface. + /// The DNS settings in network + /// interface. + /// The MAC address of the network + /// interface. + /// Gets whether this is a primary network + /// interface on a virtual machine. + /// If the network interface + /// is accelerated networking enabled. + /// Indicates whether IP forwarding + /// is enabled on this network interface. + /// The resource GUID property of the + /// network interface resource. + /// The provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// A unique read-only string that changes whenever + /// the resource is updated. + public NetworkInterface(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), SubResource virtualMachine = default(SubResource), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), NetworkInterfaceDnsSettings dnsSettings = default(NetworkInterfaceDnsSettings), string macAddress = default(string), bool? primary = default(bool?), bool? enableAcceleratedNetworking = default(bool?), bool? enableIPForwarding = default(bool?), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { VirtualMachine = virtualMachine; @@ -47,73 +69,75 @@ public NetworkInterface() { } } /// - /// Gets or sets the reference of a VirtualMachine + /// Gets or sets the reference of a virtual machine. /// - [JsonProperty(PropertyName = "properties.virtualMachine")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachine")] public SubResource VirtualMachine { get; set; } /// - /// Gets or sets the reference of the NetworkSecurityGroup resource + /// Gets or sets the reference of the NetworkSecurityGroup resource. /// - [JsonProperty(PropertyName = "properties.networkSecurityGroup")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkSecurityGroup")] public NetworkSecurityGroup NetworkSecurityGroup { get; set; } /// - /// Gets or sets list of IPConfigurations of the network interface + /// Gets or sets a list of IPConfigurations of the network interface. /// - [JsonProperty(PropertyName = "properties.ipConfigurations")] - public IList IpConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] + public System.Collections.Generic.IList IpConfigurations { get; set; } /// - /// Gets or sets DNS settings in network interface + /// Gets or sets the DNS settings in network interface. /// - [JsonProperty(PropertyName = "properties.dnsSettings")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dnsSettings")] public NetworkInterfaceDnsSettings DnsSettings { get; set; } /// - /// Gets the MAC address of the network interface + /// Gets or sets the MAC address of the network interface. /// - [JsonProperty(PropertyName = "properties.macAddress")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.macAddress")] public string MacAddress { get; set; } /// - /// Gets whether this is a primary NIC on a virtual machine + /// Gets whether this is a primary network interface on a virtual + /// machine. /// - [JsonProperty(PropertyName = "properties.primary")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primary")] public bool? Primary { get; set; } /// /// Gets or sets if the network interface is accelerated networking - /// enabled + /// enabled. /// - [JsonProperty(PropertyName = "properties.enableAcceleratedNetworking")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableAcceleratedNetworking")] public bool? EnableAcceleratedNetworking { get; set; } /// - /// Gets or sets whether IPForwarding is enabled on the NIC + /// Gets or sets indicates whether IP forwarding is enabled on this + /// network interface. /// - [JsonProperty(PropertyName = "properties.enableIPForwarding")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableIPForwarding")] public bool? EnableIPForwarding { get; set; } /// - /// Gets or sets resource guid property of the network interface - /// resource + /// Gets or sets the resource GUID property of the network interface + /// resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets or sets the provisioning state of the public IP resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceDnsSettings.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceDnsSettings.cs index ae71b6f362145..fa453f09e5e6d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceDnsSettings.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceDnsSettings.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Dns settings of a network interface + /// DNS settings of a network interface. /// public partial class NetworkInterfaceDnsSettings { @@ -31,7 +25,27 @@ public NetworkInterfaceDnsSettings() { } /// Initializes a new instance of the NetworkInterfaceDnsSettings /// class. /// - public NetworkInterfaceDnsSettings(IList dnsServers = default(IList), IList appliedDnsServers = default(IList), string internalDnsNameLabel = default(string), string internalFqdn = default(string), string internalDomainNameSuffix = default(string)) + /// List of DNS servers IP addresses. Use + /// 'AzureProvidedDNS' to switch to azure provided DNS resolution. + /// 'AzureProvidedDNS' value cannot be combined with other IPs, it + /// must be the only value in dnsServers collection. + /// If the VM that uses this NIC is + /// part of an Availability Set, then this list will have the union + /// of all DNS servers from all NICs that are part of the + /// Availability Set. This property is what is configured on each of + /// those VMs. + /// Relative DNS name for this NIC + /// used for internal communications between VMs in the same virtual + /// network. + /// Fully qualified DNS name supporting + /// internal communications between VMs in the same virtual + /// network. + /// Even if + /// internalDnsNameLabel is not specified, a DNS entry is created for + /// the primary NIC of the VM. This DNS name can be constructed by + /// concatenating the VM name with the value of + /// internalDomainNameSuffix. + public NetworkInterfaceDnsSettings(System.Collections.Generic.IList dnsServers = default(System.Collections.Generic.IList), System.Collections.Generic.IList appliedDnsServers = default(System.Collections.Generic.IList), string internalDnsNameLabel = default(string), string internalFqdn = default(string), string internalDomainNameSuffix = default(string)) { DnsServers = dnsServers; AppliedDnsServers = appliedDnsServers; @@ -41,33 +55,44 @@ public NetworkInterfaceDnsSettings() { } } /// - /// Gets or sets list of DNS servers IP addresses + /// Gets or sets list of DNS servers IP addresses. Use + /// 'AzureProvidedDNS' to switch to azure provided DNS resolution. + /// 'AzureProvidedDNS' value cannot be combined with other IPs, it + /// must be the only value in dnsServers collection. /// - [JsonProperty(PropertyName = "dnsServers")] - public IList DnsServers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dnsServers")] + public System.Collections.Generic.IList DnsServers { get; set; } /// - /// Gets or sets list of Applied DNS servers IP addresses + /// Gets or sets if the VM that uses this NIC is part of an + /// Availability Set, then this list will have the union of all DNS + /// servers from all NICs that are part of the Availability Set. This + /// property is what is configured on each of those VMs. /// - [JsonProperty(PropertyName = "appliedDnsServers")] - public IList AppliedDnsServers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "appliedDnsServers")] + public System.Collections.Generic.IList AppliedDnsServers { get; set; } /// - /// Gets or sets the internal DNS name + /// Gets or sets relative DNS name for this NIC used for internal + /// communications between VMs in the same virtual network. /// - [JsonProperty(PropertyName = "internalDnsNameLabel")] + [Newtonsoft.Json.JsonProperty(PropertyName = "internalDnsNameLabel")] public string InternalDnsNameLabel { get; set; } /// - /// Gets or sets the internal fqdn. + /// Gets or sets fully qualified DNS name supporting internal + /// communications between VMs in the same virtual network. /// - [JsonProperty(PropertyName = "internalFqdn")] + [Newtonsoft.Json.JsonProperty(PropertyName = "internalFqdn")] public string InternalFqdn { get; set; } /// - /// Gets or sets internal domain name suffix of the NIC. + /// Gets or sets even if internalDnsNameLabel is not specified, a DNS + /// entry is created for the primary NIC of the VM. This DNS name can + /// be constructed by concatenating the VM name with the value of + /// internalDomainNameSuffix. /// - [JsonProperty(PropertyName = "internalDomainNameSuffix")] + [Newtonsoft.Json.JsonProperty(PropertyName = "internalDomainNameSuffix")] public string InternalDomainNameSuffix { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceIpConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceIpConfiguration.cs index f16872a50433c..f9b7b1fb590ab 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceIpConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceIpConfiguration.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// IPConfiguration in a NetworkInterface + /// IPConfiguration in a network interface. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class NetworkInterfaceIPConfiguration : SubResource { /// @@ -32,7 +26,29 @@ public NetworkInterfaceIPConfiguration() { } /// Initializes a new instance of the NetworkInterfaceIPConfiguration /// class. /// - public NetworkInterfaceIPConfiguration(string id = default(string), IList applicationGatewayBackendAddressPools = default(IList), IList loadBalancerBackendAddressPools = default(IList), IList loadBalancerInboundNatRules = default(IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), string privateIPAddressVersion = default(string), Subnet subnet = default(Subnet), bool? primary = default(bool?), PublicIPAddress publicIPAddress = default(PublicIPAddress), string provisioningState = default(string), string name = default(string), string etag = default(string)) + /// Resource ID. + /// The reference + /// of ApplicationGatewayBackendAddressPool resource. + /// The reference of + /// LoadBalancerBackendAddressPool resource. + /// A list of references of + /// LoadBalancerInboundNatRules. + /// Defines how a private IP + /// address is assigned. Possible values are: 'Static' and 'Dynamic'. + /// Possible values include: 'Static', 'Dynamic' + /// Available from Api-Version + /// 2016-03-30 onwards, it represents whether the specific + /// ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + /// Possible values are: 'IPv4' and 'IPv6'. Possible values include: + /// 'IPv4', 'IPv6' + /// Gets whether this is a primary customer + /// address on the network interface. + /// The name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. + public NetworkInterfaceIPConfiguration(string id = default(string), System.Collections.Generic.IList applicationGatewayBackendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancerBackendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancerInboundNatRules = default(System.Collections.Generic.IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), string privateIPAddressVersion = default(string), Subnet subnet = default(Subnet), bool? primary = default(bool?), PublicIPAddress publicIPAddress = default(PublicIPAddress), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; @@ -51,76 +67,80 @@ public NetworkInterfaceIPConfiguration() { } /// /// Gets or sets the reference of ApplicationGatewayBackendAddressPool - /// resource + /// resource. /// - [JsonProperty(PropertyName = "properties.applicationGatewayBackendAddressPools")] - public IList ApplicationGatewayBackendAddressPools { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.applicationGatewayBackendAddressPools")] + public System.Collections.Generic.IList ApplicationGatewayBackendAddressPools { get; set; } /// /// Gets or sets the reference of LoadBalancerBackendAddressPool - /// resource + /// resource. /// - [JsonProperty(PropertyName = "properties.loadBalancerBackendAddressPools")] - public IList LoadBalancerBackendAddressPools { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancerBackendAddressPools")] + public System.Collections.Generic.IList LoadBalancerBackendAddressPools { get; set; } /// - /// Gets or sets list of references of LoadBalancerInboundNatRules + /// Gets or sets a list of references of LoadBalancerInboundNatRules. /// - [JsonProperty(PropertyName = "properties.loadBalancerInboundNatRules")] - public IList LoadBalancerInboundNatRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancerInboundNatRules")] + public System.Collections.Generic.IList LoadBalancerInboundNatRules { get; set; } /// /// - [JsonProperty(PropertyName = "properties.privateIPAddress")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddress")] public string PrivateIPAddress { get; set; } /// - /// Gets or sets PrivateIP allocation method. Possible values include: - /// 'Static', 'Dynamic' + /// Gets or sets defines how a private IP address is assigned. + /// Possible values are: 'Static' and 'Dynamic'. Possible values + /// include: 'Static', 'Dynamic' /// - [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] public string PrivateIPAllocationMethod { get; set; } /// - /// Gets or sets PrivateIP address version (IPv4/IPv6). Possible - /// values include: 'IPv4', 'IPv6' + /// Gets or sets available from Api-Version 2016-03-30 onwards, it + /// represents whether the specific ipconfiguration is IPv4 or IPv6. + /// Default is taken as IPv4. Possible values are: 'IPv4' and + /// 'IPv6'. Possible values include: 'IPv4', 'IPv6' /// - [JsonProperty(PropertyName = "properties.privateIPAddressVersion")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddressVersion")] public string PrivateIPAddressVersion { get; set; } /// /// - [JsonProperty(PropertyName = "properties.subnet")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] public Subnet Subnet { get; set; } /// - /// Gets whether this is a primary customer address on the NIC + /// Gets whether this is a primary customer address on the network + /// interface. /// - [JsonProperty(PropertyName = "properties.primary")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primary")] public bool? Primary { get; set; } /// /// - [JsonProperty(PropertyName = "properties.publicIPAddress")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddress")] public PublicIPAddress PublicIPAddress { get; set; } /// /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkOperationStatus.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkOperationStatus.cs index cc6c78127fb52..a6db790ba9356 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkOperationStatus.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkOperationStatus.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for NetworkOperationStatus. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkSecurityGroup.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkSecurityGroup.cs index 3873ae2d563b0..0a1313f410b05 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkSecurityGroup.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkSecurityGroup.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// NetworkSecurityGroup resource + /// NetworkSecurityGroup resource. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class NetworkSecurityGroup : Resource { /// @@ -30,7 +24,27 @@ public NetworkSecurityGroup() { } /// /// Initializes a new instance of the NetworkSecurityGroup class. /// - public NetworkSecurityGroup(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList securityRules = default(IList), IList defaultSecurityRules = default(IList), IList networkInterfaces = default(IList), IList subnets = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// A collection of security rules of the + /// network security group. + /// The default security rules of + /// network security group. + /// A collection of references to + /// network interfaces. + /// A collection of references to + /// subnets. + /// The resource GUID property of the + /// network security group resource. + /// The provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// A unique read-only string that changes whenever + /// the resource is updated. + public NetworkSecurityGroup(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList securityRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList defaultSecurityRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList networkInterfaces = default(System.Collections.Generic.IList), System.Collections.Generic.IList subnets = default(System.Collections.Generic.IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { SecurityRules = securityRules; @@ -43,48 +57,49 @@ public NetworkSecurityGroup() { } } /// - /// Gets or sets security rules of network security group + /// Gets or sets a collection of security rules of the network + /// security group. /// - [JsonProperty(PropertyName = "properties.securityRules")] - public IList SecurityRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.securityRules")] + public System.Collections.Generic.IList SecurityRules { get; set; } /// - /// Gets or default security rules of network security group + /// Gets or sets the default security rules of network security group. /// - [JsonProperty(PropertyName = "properties.defaultSecurityRules")] - public IList DefaultSecurityRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultSecurityRules")] + public System.Collections.Generic.IList DefaultSecurityRules { get; set; } /// - /// Gets collection of references to Network Interfaces + /// Gets a collection of references to network interfaces. /// - [JsonProperty(PropertyName = "properties.networkInterfaces")] - public IList NetworkInterfaces { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkInterfaces")] + public System.Collections.Generic.IList NetworkInterfaces { get; private set; } /// - /// Gets collection of references to subnets + /// Gets a collection of references to subnets. /// - [JsonProperty(PropertyName = "properties.subnets")] - public IList Subnets { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnets")] + public System.Collections.Generic.IList Subnets { get; private set; } /// - /// Gets or sets resource guid property of the network security group - /// resource + /// Gets or sets the resource GUID property of the network security + /// group resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets or sets the provisioning state of the public IP resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/OutboundNatRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/OutboundNatRule.cs index 0c452c0911666..5cb7d9a341698 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/OutboundNatRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/OutboundNatRule.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Outbound NAT pool of the load balancer + /// Outbound NAT pool of the load balancer. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class OutboundNatRule : SubResource { /// @@ -30,7 +24,23 @@ public OutboundNatRule() { } /// /// Initializes a new instance of the OutboundNatRule class. /// - public OutboundNatRule(SubResource backendAddressPool, string id = default(string), int? allocatedOutboundPorts = default(int?), IList frontendIPConfigurations = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) + /// A reference to a pool of DIPs. + /// Outbound traffic is randomly load balanced across IPs in the + /// backend IPs. + /// Resource ID. + /// The number of outbound ports + /// to be used for NAT. + /// The Frontend IP addresses + /// of the load balancer. + /// Gets the provisioning state of the + /// PublicIP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// The name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. + public OutboundNatRule(SubResource backendAddressPool, string id = default(string), int? allocatedOutboundPorts = default(int?), System.Collections.Generic.IList frontendIPConfigurations = default(System.Collections.Generic.IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { AllocatedOutboundPorts = allocatedOutboundPorts; @@ -42,53 +52,56 @@ public OutboundNatRule() { } } /// - /// Gets or sets the number of outbound ports to be used for SNAT + /// Gets or sets the number of outbound ports to be used for NAT. /// - [JsonProperty(PropertyName = "properties.allocatedOutboundPorts")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allocatedOutboundPorts")] public int? AllocatedOutboundPorts { get; set; } /// - /// Gets or sets Frontend IP addresses of the load balancer + /// Gets or sets the Frontend IP addresses of the load balancer. /// - [JsonProperty(PropertyName = "properties.frontendIPConfigurations")] - public IList FrontendIPConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfigurations")] + public System.Collections.Generic.IList FrontendIPConfigurations { get; set; } /// /// Gets or sets a reference to a pool of DIPs. Outbound traffic is - /// randomly load balanced across IPs in the backend IPs + /// randomly load balanced across IPs in the backend IPs. /// - [JsonProperty(PropertyName = "properties.backendAddressPool")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPool")] public SubResource BackendAddressPool { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the PublicIP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (BackendAddressPool == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "BackendAddressPool"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "BackendAddressPool"); } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Page.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Page.cs index 1e3a78d4e1eee..6894e76ad10b5 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Page.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Page.cs @@ -2,40 +2,36 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System.Collections.Generic; - using System.Linq; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [JsonObject] - public class Page : IPage + [Newtonsoft.Json.JsonObject] + public class Page : Microsoft.Rest.Azure.IPage { /// /// Gets the link to the next page. /// - [JsonProperty("nextLink")] - public string NextPageLink { get; private set; } + [Newtonsoft.Json.JsonProperty("nextLink")] + public System.String NextPageLink { get; private set; } - [JsonProperty("value")] - private IList Items{ get; set; } + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } /// /// Returns an enumerator that iterates through the collection. /// /// A an enumerator that can be used to iterate through the collection. - public IEnumerator GetEnumerator() + public System.Collections.Generic.IEnumerator GetEnumerator() { - return (Items == null) ? Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); } /// diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Probe.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Probe.cs index c64b49d6ab888..08bfca1ef8580 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Probe.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Probe.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Load balancer Probe + /// A load balancer probe. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Probe : SubResource { /// @@ -30,7 +24,41 @@ public Probe() { } /// /// Initializes a new instance of the Probe class. /// - public Probe(string protocol, int port, string id = default(string), IList loadBalancingRules = default(IList), int? intervalInSeconds = default(int?), int? numberOfProbes = default(int?), string requestPath = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) + /// The protocol of the end point. Possible + /// values are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received + /// ACK is required for the probe to be successful. If 'Http' is + /// specified, a 200 OK response from the specifies URI is required + /// for the probe to be successful. Possible values include: 'Http', + /// 'Tcp' + /// The port for communicating the probe. Possible + /// values range from 1 to 65535, inclusive. + /// Resource ID. + /// The load balancer rules that use + /// this probe. + /// The interval, in seconds, for how + /// frequently to probe the endpoint for health status. Typically, + /// the interval is slightly less than half the allocated timeout + /// period (in seconds) which allows two full probes before taking + /// the instance out of rotation. The default value is 15, the + /// minimum value is 5. + /// The number of probes where if no + /// response, will result in stopping further traffic from being + /// delivered to the endpoint. This values allows endpoints to be + /// taken out of rotation faster or slower than the typical times + /// used in Azure. + /// The URI used for requesting health + /// status from the VM. Path is required if a protocol is set to + /// http. Otherwise, it is not allowed. There is no default + /// value. + /// Gets the provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// Gets name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. + public Probe(string protocol, int port, string id = default(string), System.Collections.Generic.IList loadBalancingRules = default(System.Collections.Generic.IList), int? intervalInSeconds = default(int?), int? numberOfProbes = default(int?), string requestPath = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { LoadBalancingRules = loadBalancingRules; @@ -45,26 +73,26 @@ public Probe() { } } /// - /// Gets Load balancer rules that use this probe + /// Gets the load balancer rules that use this probe. /// - [JsonProperty(PropertyName = "properties.loadBalancingRules")] - public IList LoadBalancingRules { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancingRules")] + public System.Collections.Generic.IList LoadBalancingRules { get; private set; } /// - /// Gets or sets the protocol of the end point. Possible values are - /// http or Tcp. If Tcp is specified, a received ACK is required for - /// the probe to be successful. If http is specified,a 200 OK - /// response from the specifies URI is required for the probe to be - /// successful. Possible values include: 'Http', 'Tcp' + /// Gets or sets the protocol of the end point. Possible values are: + /// 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is + /// required for the probe to be successful. If 'Http' is specified, + /// a 200 OK response from the specifies URI is required for the + /// probe to be successful. Possible values include: 'Http', 'Tcp' /// - [JsonProperty(PropertyName = "properties.protocol")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// - /// Gets or sets Port for communicating the probe. Possible values + /// Gets or sets the port for communicating the probe. Possible values /// range from 1 to 65535, inclusive. /// - [JsonProperty(PropertyName = "properties.port")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.port")] public int Port { get; set; } /// @@ -72,9 +100,9 @@ public Probe() { } /// the endpoint for health status. Typically, the interval is /// slightly less than half the allocated timeout period (in seconds) /// which allows two full probes before taking the instance out of - /// rotation. The default value is 15, the minimum value is 5 + /// rotation. The default value is 15, the minimum value is 5. /// - [JsonProperty(PropertyName = "properties.intervalInSeconds")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.intervalInSeconds")] public int? IntervalInSeconds { get; set; } /// @@ -83,46 +111,49 @@ public Probe() { } /// endpoint. This values allows endpoints to be taken out of /// rotation faster or slower than the typical times used in Azure. /// - [JsonProperty(PropertyName = "properties.numberOfProbes")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.numberOfProbes")] public int? NumberOfProbes { get; set; } /// /// Gets or sets the URI used for requesting health status from the /// VM. Path is required if a protocol is set to http. Otherwise, it - /// is not allowed. There is no default value + /// is not allowed. There is no default value. /// - [JsonProperty(PropertyName = "properties.requestPath")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.requestPath")] public string RequestPath { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the public IP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (Protocol == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Protocol"); } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProbeProtocol.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProbeProtocol.cs index cdb2533714b3b..d378cd1c571d6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProbeProtocol.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProbeProtocol.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for ProbeProtocol. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProcessorArchitecture.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProcessorArchitecture.cs index ca0e05006e7db..b22d75977dfd5 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProcessorArchitecture.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProcessorArchitecture.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for ProcessorArchitecture. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddress.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddress.cs index 3f26c882394c5..bc714abca3697 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddress.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddress.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// PublicIPAddress resource + /// Public IP address resource. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PublicIPAddress : Resource { /// @@ -30,7 +24,29 @@ public PublicIPAddress() { } /// /// Initializes a new instance of the PublicIPAddress class. /// - public PublicIPAddress(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string publicIPAllocationMethod = default(string), string publicIPAddressVersion = default(string), IPConfiguration ipConfiguration = default(IPConfiguration), PublicIPAddressDnsSettings dnsSettings = default(PublicIPAddressDnsSettings), string ipAddress = default(string), int? idleTimeoutInMinutes = default(int?), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// The public IP allocation + /// method. Possible values are: 'Static' and 'Dynamic'. Possible + /// values include: 'Static', 'Dynamic' + /// The public IP address + /// version. Possible values are: 'IPv4' and 'IPv6'. Possible values + /// include: 'IPv4', 'IPv6' + /// The FQDN of the DNS record associated + /// with the public IP address. + /// The idle timeout of the public + /// IP address. + /// The resource GUID property of the + /// public IP resource. + /// The provisioning state of the + /// PublicIP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// A unique read-only string that changes whenever + /// the resource is updated. + public PublicIPAddress(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string publicIPAllocationMethod = default(string), string publicIPAddressVersion = default(string), IPConfiguration ipConfiguration = default(IPConfiguration), PublicIPAddressDnsSettings dnsSettings = default(PublicIPAddressDnsSettings), string ipAddress = default(string), int? idleTimeoutInMinutes = default(int?), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { PublicIPAllocationMethod = publicIPAllocationMethod; @@ -45,60 +61,61 @@ public PublicIPAddress() { } } /// - /// Gets or sets PublicIP allocation method (Static/Dynamic). Possible - /// values include: 'Static', 'Dynamic' + /// Gets or sets the public IP allocation method. Possible values are: + /// 'Static' and 'Dynamic'. Possible values include: 'Static', + /// 'Dynamic' /// - [JsonProperty(PropertyName = "properties.publicIPAllocationMethod")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAllocationMethod")] public string PublicIPAllocationMethod { get; set; } /// - /// Gets or sets PublicIP address version (IPv4/IPv6). Possible values - /// include: 'IPv4', 'IPv6' + /// Gets or sets the public IP address version. Possible values are: + /// 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' /// - [JsonProperty(PropertyName = "properties.publicIPAddressVersion")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddressVersion")] public string PublicIPAddressVersion { get; set; } /// /// - [JsonProperty(PropertyName = "properties.ipConfiguration")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfiguration")] public IPConfiguration IpConfiguration { get; private set; } /// - /// Gets or sets FQDN of the DNS record associated with the public IP - /// address + /// Gets or sets the FQDN of the DNS record associated with the public + /// IP address. /// - [JsonProperty(PropertyName = "properties.dnsSettings")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dnsSettings")] public PublicIPAddressDnsSettings DnsSettings { get; set; } /// /// - [JsonProperty(PropertyName = "properties.ipAddress")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipAddress")] public string IpAddress { get; set; } /// - /// Gets or sets the Idletimeout of the public IP address + /// Gets or sets the idle timeout of the public IP address. /// - [JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] public int? IdleTimeoutInMinutes { get; set; } /// - /// Gets or sets resource guid property of the PublicIP resource + /// Gets or sets the resource GUID property of the public IP resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets or sets the provisioning state of the PublicIP resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddressDnsSettings.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddressDnsSettings.cs index f46076fbde5dc..3298d22a9e069 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddressDnsSettings.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddressDnsSettings.cs @@ -2,22 +2,17 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Contains FQDN of the DNS record associated with the public IP address + /// Contains the FQDN of the DNS record associated with the public IP + /// address. /// public partial class PublicIPAddressDnsSettings { @@ -29,6 +24,21 @@ public PublicIPAddressDnsSettings() { } /// /// Initializes a new instance of the PublicIPAddressDnsSettings class. /// + /// The domain name label. The + /// concatenation of the domain name label and the regionalized DNS + /// zone make up the fully qualified domain name associated with the + /// public IP address. If a domain name label is specified, an A DNS + /// record is created for the public IP in the Microsoft Azure DNS + /// system. + /// The FQDN (fully qualified domain name) of the A + /// DNS record associated with the public IP. This is the + /// concatenation of the domainNameLabel and the regionalized DNS + /// zone. + /// The reverse FQDN. A user-visible, fully + /// qualified domain name that resolves to this public IP address. If + /// the reverseFqdn is specified, then a PTR DNS record is created + /// pointing from the IP address in the in-addr.arpa domain to the + /// reverse FQDN. public PublicIPAddressDnsSettings(string domainNameLabel = default(string), string fqdn = default(string), string reverseFqdn = default(string)) { DomainNameLabel = domainNameLabel; @@ -37,31 +47,31 @@ public PublicIPAddressDnsSettings() { } } /// - /// Gets or sets the Domain name label.The concatenation of the domain - /// name label and the regionalized DNS zone make up the fully + /// Gets or sets the domain name label. The concatenation of the + /// domain name label and the regionalized DNS zone make up the fully /// qualified domain name associated with the public IP address. If a /// domain name label is specified, an A DNS record is created for /// the public IP in the Microsoft Azure DNS system. /// - [JsonProperty(PropertyName = "domainNameLabel")] + [Newtonsoft.Json.JsonProperty(PropertyName = "domainNameLabel")] public string DomainNameLabel { get; set; } /// - /// Gets the FQDN, Fully qualified domain name of the A DNS record - /// associated with the public IP. This is the concatenation of the - /// domainNameLabel and the regionalized DNS zone. + /// Gets or sets the FQDN (fully qualified domain name) of the A DNS + /// record associated with the public IP. This is the concatenation + /// of the domainNameLabel and the regionalized DNS zone. /// - [JsonProperty(PropertyName = "fqdn")] + [Newtonsoft.Json.JsonProperty(PropertyName = "fqdn")] public string Fqdn { get; set; } /// - /// Gets or Sets the Reverse FQDN. A user-visible, fully qualified + /// Gets or sets the reverse FQDN. A user-visible, fully qualified /// domain name that resolves to this public IP address. If the /// reverseFqdn is specified, then a PTR DNS record is created /// pointing from the IP address in the in-addr.arpa domain to the /// reverse FQDN. /// - [JsonProperty(PropertyName = "reverseFqdn")] + [Newtonsoft.Json.JsonProperty(PropertyName = "reverseFqdn")] public string ReverseFqdn { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Resource.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Resource.cs index ad306ce94e3ee..55e88c3769d20 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Resource.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Resource.cs @@ -2,21 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; - public partial class Resource : IResource + public partial class Resource : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the Resource class. @@ -26,7 +20,12 @@ public Resource() { } /// /// Initializes a new instance of the Resource class. /// - public Resource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary)) + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + public Resource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) { Id = id; Name = name; @@ -36,34 +35,34 @@ public Resource() { } } /// - /// Resource Id + /// Gets or sets resource ID. /// - [JsonProperty(PropertyName = "id")] + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] public string Id { get; set; } /// - /// Resource name + /// Gets resource name. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; private set; } /// - /// Resource type + /// Gets resource type. /// - [JsonProperty(PropertyName = "type")] + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] public string Type { get; private set; } /// - /// Resource location + /// Gets or sets resource location. /// - [JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] public string Location { get; set; } /// - /// Resource tags + /// Gets or sets resource tags. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags { get; set; } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ResourceNavigationLink.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ResourceNavigationLink.cs index 04c2be0fd584e..bf119472dcc20 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ResourceNavigationLink.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ResourceNavigationLink.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// ResourceNavigationLink resource + /// ResourceNavigationLink resource. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ResourceNavigationLink : SubResource { /// @@ -30,6 +24,17 @@ public ResourceNavigationLink() { } /// /// Initializes a new instance of the ResourceNavigationLink class. /// + /// Resource ID. + /// Resource type of the linked + /// resource. + /// Link to the external resource + /// Provisioning state of the + /// ResourceNavigationLink resource. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ResourceNavigationLink(string id = default(string), string linkedResourceType = default(string), string link = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -41,35 +46,35 @@ public ResourceNavigationLink() { } } /// - /// Resource type of the linked resource + /// Gets or sets resource type of the linked resource. /// - [JsonProperty(PropertyName = "properties.linkedResourceType")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.linkedResourceType")] public string LinkedResourceType { get; set; } /// - /// Link to the external resource + /// Gets or sets link to the external resource /// - [JsonProperty(PropertyName = "properties.link")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.link")] public string Link { get; set; } /// - /// Provisioning state of the ResourceNavigationLink resource + /// Gets provisioning state of the ResourceNavigationLink resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Route.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Route.cs index b368415fc4b2a..7d74d21fa0d81 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Route.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Route.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// /// Route resource /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Route : SubResource { /// @@ -30,6 +24,25 @@ public Route() { } /// /// Initializes a new instance of the Route class. /// + /// The type of Azure hop the packet should + /// be sent to. Possible values are: 'VirtualNetworkGateway', + /// 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible + /// values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + /// 'VirtualAppliance', 'None' + /// Resource ID. + /// The destination CIDR to which the + /// route applies. + /// The IP address packets should be + /// forwarded to. Next hop values are only allowed in routes where + /// the next hop type is VirtualAppliance. + /// The provisioning state of the + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// The name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public Route(string nextHopType, string id = default(string), string addressPrefix = default(string), string nextHopIpAddress = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -44,15 +57,17 @@ public Route() { } /// /// Gets or sets the destination CIDR to which the route applies. /// - [JsonProperty(PropertyName = "properties.addressPrefix")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.addressPrefix")] public string AddressPrefix { get; set; } /// /// Gets or sets the type of Azure hop the packet should be sent to. - /// Possible values include: 'VirtualNetworkGateway', 'VnetLocal', - /// 'Internet', 'VirtualAppliance', 'None' + /// Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + /// 'Internet', 'VirtualAppliance', and 'None'. Possible values + /// include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + /// 'VirtualAppliance', 'None' /// - [JsonProperty(PropertyName = "properties.nextHopType")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.nextHopType")] public string NextHopType { get; set; } /// @@ -60,37 +75,41 @@ public Route() { } /// hop values are only allowed in routes where the next hop type is /// VirtualAppliance. /// - [JsonProperty(PropertyName = "properties.nextHopIpAddress")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.nextHopIpAddress")] public string NextHopIpAddress { get; set; } /// - /// Gets provisioning state of the resource Updating/Deleting/Failed + /// Gets or sets the provisioning state of the resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (NextHopType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "NextHopType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "NextHopType"); } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteNextHopType.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteNextHopType.cs index 72b9e5fa8e9eb..3d782fcd78c45 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteNextHopType.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteNextHopType.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for RouteNextHopType. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteTable.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteTable.cs index a5ff1aa40c586..cfb221662409e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteTable.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteTable.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// RouteTable resource + /// Route table resource. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class RouteTable : Resource { /// @@ -30,7 +24,21 @@ public RouteTable() { } /// /// Initializes a new instance of the RouteTable class. /// - public RouteTable(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList routes = default(IList), IList subnets = default(IList), string provisioningState = default(string), string etag = default(string)) + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// Collection of routes contained within a route + /// table. + /// A collection of references to + /// subnets. + /// The provisioning state of the + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// Gets a unique read-only string that changes + /// whenever the resource is updated. + public RouteTable(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList routes = default(System.Collections.Generic.IList), System.Collections.Generic.IList subnets = default(System.Collections.Generic.IList), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { Routes = routes; @@ -40,28 +48,29 @@ public RouteTable() { } } /// - /// Gets or sets Routes in a Route Table + /// Gets or sets collection of routes contained within a route table. /// - [JsonProperty(PropertyName = "properties.routes")] - public IList Routes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routes")] + public System.Collections.Generic.IList Routes { get; set; } /// - /// Gets collection of references to subnets + /// Gets a collection of references to subnets. /// - [JsonProperty(PropertyName = "properties.subnets")] - public IList Subnets { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnets")] + public System.Collections.Generic.IList Subnets { get; private set; } /// - /// Gets provisioning state of the resource Updating/Deleting/Failed + /// Gets or sets the provisioning state of the resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets a unique read-only string that changes whenever the resource - /// is updated + /// is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRule.cs index 86fa244418001..8e8a7fe00fb29 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRule.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Network security rule + /// Network security rule. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class SecurityRule : SubResource { /// @@ -30,6 +24,46 @@ public SecurityRule() { } /// /// Initializes a new instance of the SecurityRule class. /// + /// Network protocol this rule applies to. + /// Possible values are 'Tcp', 'Udp', and '*'. Possible values + /// include: 'Tcp', 'Udp', '*' + /// The CIDR or source IP range. + /// Asterix '*' can also be used to match all source IPs. Default + /// tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' + /// can also be used. If this is an ingress rule, specifies where + /// network traffic originates from. + /// The destination address + /// prefix. CIDR or source IP range. Asterix '*' can also be used to + /// match all source IPs. Default tags such as 'VirtualNetwork', + /// 'AzureLoadBalancer' and 'Internet' can also be used. + /// The network traffic is allowed or denied. + /// Possible values are: 'Allow' and 'Deny'. Possible values include: + /// 'Allow', 'Deny' + /// The direction of the rule. The direction + /// specifies if rule will be evaluated on incoming or outcoming + /// traffic. Possible values are: 'Inbound' and 'Outbound'. Possible + /// values include: 'Inbound', 'Outbound' + /// Resource ID. + /// A description for this rule. Restricted + /// to 140 chars. + /// The source port or range. Integer or + /// range between 0 and 65535. Asterix '*' can also be used to match + /// all ports. + /// The destination port or range. + /// Integer or range between 0 and 65535. Asterix '*' can also be + /// used to match all ports. + /// The priority of the rule. The value can be + /// between 100 and 4096. The priority number must be unique for each + /// rule in the collection. The lower the priority number, the higher + /// the priority of the rule. + /// The provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// The name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public SecurityRule(string protocol, string sourceAddressPrefix, string destinationAddressPrefix, string access, string direction, string id = default(string), string description = default(string), string sourcePortRange = default(string), string destinationPortRange = default(string), int? priority = default(int?), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -50,54 +84,57 @@ public SecurityRule() { } /// /// Gets or sets a description for this rule. Restricted to 140 chars. /// - [JsonProperty(PropertyName = "properties.description")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] public string Description { get; set; } /// - /// Gets or sets Network protocol this rule applies to. Can be Tcp, - /// Udp or All(*). Possible values include: 'Tcp', 'Udp', '*' + /// Gets or sets network protocol this rule applies to. Possible + /// values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', + /// 'Udp', '*' /// - [JsonProperty(PropertyName = "properties.protocol")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// - /// Gets or sets Source Port or Range. Integer or range between 0 and - /// 65535. Asterix '*' can also be used to match all ports. + /// Gets or sets the source port or range. Integer or range between 0 + /// and 65535. Asterix '*' can also be used to match all ports. /// - [JsonProperty(PropertyName = "properties.sourcePortRange")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourcePortRange")] public string SourcePortRange { get; set; } /// - /// Gets or sets Destination Port or Range. Integer or range between 0 - /// and 65535. Asterix '*' can also be used to match all ports. + /// Gets or sets the destination port or range. Integer or range + /// between 0 and 65535. Asterix '*' can also be used to match all + /// ports. /// - [JsonProperty(PropertyName = "properties.destinationPortRange")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinationPortRange")] public string DestinationPortRange { get; set; } /// - /// Gets or sets source address prefix. CIDR or source IP range. - /// Asterix '*' can also be used to match all source IPs. Default - /// tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - /// can also be used. If this is an ingress rule, specifies where - /// network traffic originates from. + /// Gets or sets the CIDR or source IP range. Asterix '*' can also be + /// used to match all source IPs. Default tags such as + /// 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be + /// used. If this is an ingress rule, specifies where network traffic + /// originates from. /// - [JsonProperty(PropertyName = "properties.sourceAddressPrefix")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourceAddressPrefix")] public string SourceAddressPrefix { get; set; } /// - /// Gets or sets destination address prefix. CIDR or source IP range. - /// Asterix '*' can also be used to match all source IPs. Default - /// tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - /// can also be used. + /// Gets or sets the destination address prefix. CIDR or source IP + /// range. Asterix '*' can also be used to match all source IPs. + /// Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and + /// 'Internet' can also be used. /// - [JsonProperty(PropertyName = "properties.destinationAddressPrefix")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinationAddressPrefix")] public string DestinationAddressPrefix { get; set; } /// - /// Gets or sets network traffic is allowed or denied. Possible values - /// are 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + /// Gets or sets the network traffic is allowed or denied. Possible + /// values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + /// 'Deny' /// - [JsonProperty(PropertyName = "properties.access")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.access")] public string Access { get; set; } /// @@ -106,62 +143,66 @@ public SecurityRule() { } /// the collection. The lower the priority number, the higher the /// priority of the rule. /// - [JsonProperty(PropertyName = "properties.priority")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priority")] public int? Priority { get; set; } /// - /// Gets or sets the direction of the rule.InBound or Outbound. The - /// direction specifies if rule will be evaluated on incoming or - /// outcoming traffic. Possible values include: 'Inbound', 'Outbound' + /// Gets or sets the direction of the rule. The direction specifies if + /// rule will be evaluated on incoming or outcoming traffic. Possible + /// values are: 'Inbound' and 'Outbound'. Possible values include: + /// 'Inbound', 'Outbound' /// - [JsonProperty(PropertyName = "properties.direction")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.direction")] public string Direction { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets or sets the provisioning state of the public IP resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (Protocol == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Protocol"); } if (SourceAddressPrefix == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "SourceAddressPrefix"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "SourceAddressPrefix"); } if (DestinationAddressPrefix == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "DestinationAddressPrefix"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DestinationAddressPrefix"); } if (Access == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Access"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Access"); } if (Direction == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Direction"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Direction"); } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleAccess.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleAccess.cs index 81e609d48e8a2..78db23993f926 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleAccess.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleAccess.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for SecurityRuleAccess. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleDirection.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleDirection.cs index fe0144f41b00d..3af4f1915d01a 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleDirection.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleDirection.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for SecurityRuleDirection. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleProtocol.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleProtocol.cs index 4aba5be7522fc..3ad57550e2682 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleProtocol.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleProtocol.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for SecurityRuleProtocol. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ServiceProviderProvisioningState.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ServiceProviderProvisioningState.cs index 68f3624374d7e..9bd50cd1fe5d6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ServiceProviderProvisioningState.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ServiceProviderProvisioningState.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for ServiceProviderProvisioningState. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SubResource.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SubResource.cs index 04b4d4959c471..918737cb97f2b 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SubResource.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SubResource.cs @@ -2,21 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; - public partial class SubResource : IResource + public partial class SubResource : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the SubResource class. @@ -26,15 +20,16 @@ public SubResource() { } /// /// Initializes a new instance of the SubResource class. /// + /// Resource ID. public SubResource(string id = default(string)) { Id = id; } /// - /// Resource Id + /// Gets or sets resource ID. /// - [JsonProperty(PropertyName = "id")] + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] public string Id { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Subnet.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Subnet.cs index ddd40a6e277a2..061930fbf5023 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Subnet.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Subnet.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Subnet in a VirtualNework resource + /// Subnet in a virtual network resource. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Subnet : SubResource { /// @@ -30,7 +24,25 @@ public Subnet() { } /// /// Initializes a new instance of the Subnet class. /// - public Subnet(string id = default(string), string addressPrefix = default(string), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), RouteTable routeTable = default(RouteTable), IList ipConfigurations = default(IList), IList resourceNavigationLinks = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) + /// Resource ID. + /// The address prefix for the + /// subnet. + /// The reference of the + /// NetworkSecurityGroup resource. + /// The reference of the RouteTable + /// resource. + /// Gets an array of references to the + /// network interface IP configurations using subnet. + /// Gets an array of references + /// to the external resources using subnet. + /// The provisioning state of the + /// resource. + /// The name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. + public Subnet(string id = default(string), string addressPrefix = default(string), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), RouteTable routeTable = default(RouteTable), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList resourceNavigationLinks = default(System.Collections.Generic.IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { AddressPrefix = addressPrefix; @@ -44,54 +56,54 @@ public Subnet() { } } /// - /// Gets or sets Address prefix for the subnet. + /// Gets or sets the address prefix for the subnet. /// - [JsonProperty(PropertyName = "properties.addressPrefix")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.addressPrefix")] public string AddressPrefix { get; set; } /// - /// Gets or sets the reference of the NetworkSecurityGroup resource + /// Gets or sets the reference of the NetworkSecurityGroup resource. /// - [JsonProperty(PropertyName = "properties.networkSecurityGroup")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkSecurityGroup")] public NetworkSecurityGroup NetworkSecurityGroup { get; set; } /// - /// Gets or sets the reference of the RouteTable resource + /// Gets or sets the reference of the RouteTable resource. /// - [JsonProperty(PropertyName = "properties.routeTable")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routeTable")] public RouteTable RouteTable { get; set; } /// - /// Gets array of references to the network interface IP - /// configurations using subnet + /// Gets an array of references to the network interface IP + /// configurations using subnet. /// - [JsonProperty(PropertyName = "properties.ipConfigurations")] - public IList IpConfigurations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] + public System.Collections.Generic.IList IpConfigurations { get; private set; } /// - /// Gets array of references to the external resources using subnet + /// Gets an array of references to the external resources using subnet. /// - [JsonProperty(PropertyName = "properties.resourceNavigationLinks")] - public IList ResourceNavigationLinks { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceNavigationLinks")] + public System.Collections.Generic.IList ResourceNavigationLinks { get; set; } /// - /// Gets provisioning state of the resource + /// Gets or sets the provisioning state of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource + /// resource group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TransportProtocol.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TransportProtocol.cs index f6ab2f77b1f3c..aedeefd1af1cc 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TransportProtocol.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TransportProtocol.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for TransportProtocol. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TunnelConnectionHealth.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TunnelConnectionHealth.cs index c17f5e2003eb9..fddfc7f52bd9f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TunnelConnectionHealth.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TunnelConnectionHealth.cs @@ -2,19 +2,13 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// /// VirtualNetworkGatewayConnection properties @@ -29,6 +23,16 @@ public TunnelConnectionHealth() { } /// /// Initializes a new instance of the TunnelConnectionHealth class. /// + /// Tunnel name. + /// Virtual network Gateway connection + /// status. Possible values include: 'Unknown', 'Connecting', + /// 'Connected', 'NotConnected' + /// The Ingress Bytes + /// Transferred in this connection + /// The Egress Bytes Transferred + /// in this connection + /// The time at which + /// connection was established in Utc format. public TunnelConnectionHealth(string tunnel = default(string), string connectionStatus = default(string), long? ingressBytesTransferred = default(long?), long? egressBytesTransferred = default(long?), string lastConnectionEstablishedUtcTime = default(string)) { Tunnel = tunnel; @@ -39,34 +43,34 @@ public TunnelConnectionHealth() { } } /// - /// Tunnel name. + /// Gets tunnel name. /// - [JsonProperty(PropertyName = "tunnel")] + [Newtonsoft.Json.JsonProperty(PropertyName = "tunnel")] public string Tunnel { get; private set; } /// - /// Virtual network Gateway connection status. Possible values + /// Gets virtual network Gateway connection status. Possible values /// include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' /// - [JsonProperty(PropertyName = "connectionStatus")] + [Newtonsoft.Json.JsonProperty(PropertyName = "connectionStatus")] public string ConnectionStatus { get; private set; } /// - /// The Ingress Bytes Transferred in this connection + /// Gets the Ingress Bytes Transferred in this connection /// - [JsonProperty(PropertyName = "ingressBytesTransferred")] + [Newtonsoft.Json.JsonProperty(PropertyName = "ingressBytesTransferred")] public long? IngressBytesTransferred { get; private set; } /// - /// The Egress Bytes Transferred in this connection + /// Gets the Egress Bytes Transferred in this connection /// - [JsonProperty(PropertyName = "egressBytesTransferred")] + [Newtonsoft.Json.JsonProperty(PropertyName = "egressBytesTransferred")] public long? EgressBytesTransferred { get; private set; } /// - /// The time at which connection was established in Utc format. + /// Gets the time at which connection was established in Utc format. /// - [JsonProperty(PropertyName = "lastConnectionEstablishedUtcTime")] + [Newtonsoft.Json.JsonProperty(PropertyName = "lastConnectionEstablishedUtcTime")] public string LastConnectionEstablishedUtcTime { get; private set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Usage.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Usage.cs index 6d5030d15ae7f..b866af41e71e3 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Usage.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Usage.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Describes Network Resource Usage. + /// Describes network resource usage. /// public partial class Usage { @@ -29,6 +23,9 @@ public Usage() { } /// /// Initializes a new instance of the Usage class. /// + /// The current value of the usage. + /// The limit of usage. + /// The name of the type of usage. public Usage(long currentValue, long limit, UsageName name) { CurrentValue = currentValue; @@ -46,35 +43,38 @@ static Usage() /// /// Gets or sets the current value of the usage. /// - [JsonProperty(PropertyName = "currentValue")] + [Newtonsoft.Json.JsonProperty(PropertyName = "currentValue")] public long CurrentValue { get; set; } /// /// Gets or sets the limit of usage. /// - [JsonProperty(PropertyName = "limit")] + [Newtonsoft.Json.JsonProperty(PropertyName = "limit")] public long Limit { get; set; } /// /// Gets or sets the name of the type of usage. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public UsageName Name { get; set; } /// - /// Gets or sets an enum describing the unit of measurement. + /// An enum describing the unit of measurement. /// - [JsonProperty(PropertyName = "unit")] + [Newtonsoft.Json.JsonProperty(PropertyName = "unit")] public static string Unit { get; private set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/UsageName.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/UsageName.cs index d99361b65326b..0960abdb46b05 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/UsageName.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/UsageName.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// The Usage Names. + /// The usage names. /// public partial class UsageName { @@ -29,6 +23,9 @@ public UsageName() { } /// /// Initializes a new instance of the UsageName class. /// + /// A string describing the resource name. + /// A localized string describing the + /// resource name. public UsageName(string value = default(string), string localizedValue = default(string)) { Value = value; @@ -38,13 +35,13 @@ public UsageName() { } /// /// Gets or sets a string describing the resource name. /// - [JsonProperty(PropertyName = "value")] + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] public string Value { get; set; } /// /// Gets or sets a localized string describing the resource name. /// - [JsonProperty(PropertyName = "localizedValue")] + [Newtonsoft.Json.JsonProperty(PropertyName = "localizedValue")] public string LocalizedValue { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetwork.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetwork.cs index d6f4d3dfa2840..5c668135285c7 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetwork.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetwork.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Virtual Network resource + /// Virtual Network resource. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualNetwork : Resource { /// @@ -30,7 +24,28 @@ public VirtualNetwork() { } /// /// Initializes a new instance of the VirtualNetwork class. /// - public VirtualNetwork(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), AddressSpace addressSpace = default(AddressSpace), DhcpOptions dhcpOptions = default(DhcpOptions), IList subnets = default(IList), IList virtualNetworkPeerings = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// The AddressSpace that contains an array + /// of IP address ranges that can be used by subnets. + /// The dhcpOptions that contains an array + /// of DNS servers available to VMs deployed in the virtual + /// network. + /// A list of subnets in a Virtual + /// Network. + /// A list of peerings in a + /// Virtual Network. + /// The resourceGuid property of the + /// Virtual Network resource. + /// The provisioning state of the + /// PublicIP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// Gets a unique read-only string that changes + /// whenever the resource is updated. + public VirtualNetwork(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), AddressSpace addressSpace = default(AddressSpace), DhcpOptions dhcpOptions = default(DhcpOptions), System.Collections.Generic.IList subnets = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualNetworkPeerings = default(System.Collections.Generic.IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { AddressSpace = addressSpace; @@ -43,49 +58,50 @@ public VirtualNetwork() { } } /// - /// Gets or sets AddressSpace that contains an array of IP address - /// ranges that can be used by subnets + /// Gets or sets the AddressSpace that contains an array of IP address + /// ranges that can be used by subnets. /// - [JsonProperty(PropertyName = "properties.addressSpace")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.addressSpace")] public AddressSpace AddressSpace { get; set; } /// - /// Gets or sets DHCPOptions that contains an array of DNS servers - /// available to VMs deployed in the virtual network + /// Gets or sets the dhcpOptions that contains an array of DNS servers + /// available to VMs deployed in the virtual network. /// - [JsonProperty(PropertyName = "properties.dhcpOptions")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dhcpOptions")] public DhcpOptions DhcpOptions { get; set; } /// - /// Gets or sets list of subnets in a VirtualNetwork + /// Gets or sets a list of subnets in a Virtual Network. /// - [JsonProperty(PropertyName = "properties.subnets")] - public IList Subnets { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnets")] + public System.Collections.Generic.IList Subnets { get; set; } /// - /// Gets or sets list of peerings in a VirtualNetwork + /// Gets or sets a list of peerings in a Virtual Network. /// - [JsonProperty(PropertyName = "properties.VirtualNetworkPeerings")] - public IList VirtualNetworkPeerings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualNetworkPeerings")] + public System.Collections.Generic.IList VirtualNetworkPeerings { get; set; } /// - /// Gets or sets resource guid property of the VirtualNetwork resource + /// Gets or sets the resourceGuid property of the Virtual Network + /// resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets or sets the provisioning state of the PublicIP resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets a unique read-only string that changes whenever the resource - /// is updated + /// is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGateway.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGateway.cs index 3fce3791d7c46..20eafd3c6c8c2 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGateway.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGateway.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// /// A common class for general resource information /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualNetworkGateway : Resource { /// @@ -30,7 +24,42 @@ public VirtualNetworkGateway() { } /// /// Initializes a new instance of the VirtualNetworkGateway class. /// - public VirtualNetworkGateway(IList ipConfigurations, string gatewayType, string vpnType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), bool? enableBgp = default(bool?), bool? activeActive = default(bool?), SubResource gatewayDefaultSite = default(SubResource), VirtualNetworkGatewaySku sku = default(VirtualNetworkGatewaySku), VpnClientConfiguration vpnClientConfiguration = default(VpnClientConfiguration), BgpSettings bgpSettings = default(BgpSettings), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + /// IP configurations for virtual + /// network gateway. + /// The type of this virtual network + /// gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible + /// values include: 'Vpn', 'ExpressRoute' + /// The type of this virtual network gateway. + /// Possible values are: 'PolicyBased' and 'RouteBased'. Possible + /// values include: 'PolicyBased', 'RouteBased' + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// Whether BGP is enabled for this virtual + /// network gateway or not. + /// ActiveActive flag + /// The reference of the + /// LocalNetworkGateway resource which represents local network site + /// having default routes. Assign Null value in case of removing + /// existing default site setting. + /// The reference of the VirtualNetworkGatewaySku + /// resource which represents the SKU selected for Virtual network + /// gateway. + /// The reference of the + /// VpnClientConfiguration resource which represents the P2S + /// VpnClient configurations. + /// Virtual network gateway's BGP speaker + /// settings. + /// The resource GUID property of the + /// VirtualNetworkGateway resource. + /// The provisioning state of the + /// VirtualNetworkGateway resource. Possible values are: 'Updating', + /// 'Deleting', and 'Failed'. + /// Gets a unique read-only string that changes + /// whenever the resource is updated. + public VirtualNetworkGateway(System.Collections.Generic.IList ipConfigurations, string gatewayType, string vpnType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), bool? enableBgp = default(bool?), bool? activeActive = default(bool?), SubResource gatewayDefaultSite = default(SubResource), VirtualNetworkGatewaySku sku = default(VirtualNetworkGatewaySku), VpnClientConfiguration vpnClientConfiguration = default(VpnClientConfiguration), BgpSettings bgpSettings = default(BgpSettings), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { IpConfigurations = ipConfigurations; @@ -48,103 +77,109 @@ public VirtualNetworkGateway() { } } /// - /// IpConfigurations for Virtual network gateway. + /// Gets or sets IP configurations for virtual network gateway. /// - [JsonProperty(PropertyName = "properties.ipConfigurations")] - public IList IpConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] + public System.Collections.Generic.IList IpConfigurations { get; set; } /// - /// The type of this virtual network gateway. Possible values include: + /// Gets or sets the type of this virtual network gateway. Possible + /// values are: 'Vpn' and 'ExpressRoute'. Possible values include: /// 'Vpn', 'ExpressRoute' /// - [JsonProperty(PropertyName = "properties.gatewayType")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayType")] public string GatewayType { get; set; } /// - /// The type of this virtual network gateway. Possible values include: - /// 'PolicyBased', 'RouteBased' + /// Gets or sets the type of this virtual network gateway. Possible + /// values are: 'PolicyBased' and 'RouteBased'. Possible values + /// include: 'PolicyBased', 'RouteBased' /// - [JsonProperty(PropertyName = "properties.vpnType")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnType")] public string VpnType { get; set; } /// - /// EnableBgp Flag + /// Gets or sets whether BGP is enabled for this virtual network + /// gateway or not. /// - [JsonProperty(PropertyName = "properties.enableBgp")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableBgp")] public bool? EnableBgp { get; set; } /// - /// ActiveActive flag + /// Gets or sets activeActive flag /// - [JsonProperty(PropertyName = "properties.activeActive")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.activeActive")] public bool? ActiveActive { get; set; } /// /// Gets or sets the reference of the LocalNetworkGateway resource - /// which represents Local network site having default routes. Assign + /// which represents local network site having default routes. Assign /// Null value in case of removing existing default site setting. /// - [JsonProperty(PropertyName = "properties.gatewayDefaultSite")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayDefaultSite")] public SubResource GatewayDefaultSite { get; set; } /// /// Gets or sets the reference of the VirtualNetworkGatewaySku - /// resource which represents the sku selected for Virtual network + /// resource which represents the SKU selected for Virtual network /// gateway. /// - [JsonProperty(PropertyName = "properties.sku")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sku")] public VirtualNetworkGatewaySku Sku { get; set; } /// /// Gets or sets the reference of the VpnClientConfiguration resource /// which represents the P2S VpnClient configurations. /// - [JsonProperty(PropertyName = "properties.vpnClientConfiguration")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnClientConfiguration")] public VpnClientConfiguration VpnClientConfiguration { get; set; } /// - /// Virtual network gateway's BGP speaker settings + /// Gets or sets virtual network gateway's BGP speaker settings. /// - [JsonProperty(PropertyName = "properties.bgpSettings")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bgpSettings")] public BgpSettings BgpSettings { get; set; } /// - /// Gets or sets resource guid property of the VirtualNetworkGateway - /// resource + /// Gets or sets the resource GUID property of the + /// VirtualNetworkGateway resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// - /// Gets provisioning state of the VirtualNetworkGateway resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the VirtualNetworkGateway resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } /// /// Gets a unique read-only string that changes whenever the resource - /// is updated + /// is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (IpConfigurations == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "IpConfigurations"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "IpConfigurations"); } if (GatewayType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "GatewayType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "GatewayType"); } if (VpnType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "VpnType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "VpnType"); } if (this.IpConfigurations != null) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnection.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnection.cs index 0e0fb05490bbd..4874f6d8b9b6d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnection.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnection.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// /// A common class for general resource information /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualNetworkGatewayConnection : Resource { /// @@ -32,7 +26,38 @@ public VirtualNetworkGatewayConnection() { } /// Initializes a new instance of the VirtualNetworkGatewayConnection /// class. /// - public VirtualNetworkGatewayConnection(VirtualNetworkGateway virtualNetworkGateway1, string connectionType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string authorizationKey = default(string), VirtualNetworkGateway virtualNetworkGateway2 = default(VirtualNetworkGateway), LocalNetworkGateway localNetworkGateway2 = default(LocalNetworkGateway), int? routingWeight = default(int?), string sharedKey = default(string), string connectionStatus = default(string), IList tunnelConnectionStatus = default(IList), long? egressBytesTransferred = default(long?), long? ingressBytesTransferred = default(long?), SubResource peer = default(SubResource), bool? enableBgp = default(bool?), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + /// Gateway connection type. Possible + /// values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. + /// Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', + /// 'VPNClient' + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// The authorizationKey. + /// The routing weight. + /// The IPSec shared key. + /// Virtual network Gateway connection + /// status. Possible values are 'Unknown', 'Connecting', 'Connected' + /// and 'NotConnected'. Possible values include: 'Unknown', + /// 'Connecting', 'Connected', 'NotConnected' + /// Collection of all tunnels' + /// connection health status. + /// The egress bytes transferred + /// in this connection. + /// The ingress bytes + /// transferred in this connection. + /// The reference to peerings resource. + /// EnableBgp flag + /// The resource GUID property of the + /// VirtualNetworkGatewayConnection resource. + /// The provisioning state of the + /// VirtualNetworkGatewayConnection resource. Possible values are: + /// 'Updating', 'Deleting', and 'Failed'. + /// Gets a unique read-only string that changes + /// whenever the resource is updated. + public VirtualNetworkGatewayConnection(VirtualNetworkGateway virtualNetworkGateway1, string connectionType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string authorizationKey = default(string), VirtualNetworkGateway virtualNetworkGateway2 = default(VirtualNetworkGateway), LocalNetworkGateway localNetworkGateway2 = default(LocalNetworkGateway), int? routingWeight = default(int?), string sharedKey = default(string), string connectionStatus = default(string), System.Collections.Generic.IList tunnelConnectionStatus = default(System.Collections.Generic.IList), long? egressBytesTransferred = default(long?), long? ingressBytesTransferred = default(long?), SubResource peer = default(SubResource), bool? enableBgp = default(bool?), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { AuthorizationKey = authorizationKey; @@ -54,116 +79,122 @@ public VirtualNetworkGatewayConnection() { } } /// - /// The authorizationKey. + /// Gets or sets the authorizationKey. /// - [JsonProperty(PropertyName = "properties.authorizationKey")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authorizationKey")] public string AuthorizationKey { get; set; } /// /// - [JsonProperty(PropertyName = "properties.virtualNetworkGateway1")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualNetworkGateway1")] public VirtualNetworkGateway VirtualNetworkGateway1 { get; set; } /// /// - [JsonProperty(PropertyName = "properties.virtualNetworkGateway2")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualNetworkGateway2")] public VirtualNetworkGateway VirtualNetworkGateway2 { get; set; } /// /// - [JsonProperty(PropertyName = "properties.localNetworkGateway2")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.localNetworkGateway2")] public LocalNetworkGateway LocalNetworkGateway2 { get; set; } /// - /// Gateway connection type -Ipsec/Dedicated/VpnClient/Vnet2Vnet. - /// Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', - /// 'VPNClient' + /// Gets or sets gateway connection type. Possible values are: + /// 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible + /// values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' /// - [JsonProperty(PropertyName = "properties.connectionType")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionType")] public string ConnectionType { get; set; } /// - /// The Routing weight. + /// Gets or sets the routing weight. /// - [JsonProperty(PropertyName = "properties.routingWeight")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routingWeight")] public int? RoutingWeight { get; set; } /// - /// The Ipsec share key. + /// Gets or sets the IPSec shared key. /// - [JsonProperty(PropertyName = "properties.sharedKey")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sharedKey")] public string SharedKey { get; set; } /// - /// Virtual network Gateway connection status. Possible values - /// include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' + /// Gets virtual network Gateway connection status. Possible values + /// are 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. + /// Possible values include: 'Unknown', 'Connecting', 'Connected', + /// 'NotConnected' /// - [JsonProperty(PropertyName = "properties.connectionStatus")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionStatus")] public string ConnectionStatus { get; private set; } /// - /// Collection of all tunnels' connection health status. + /// Gets collection of all tunnels' connection health status. /// - [JsonProperty(PropertyName = "properties.tunnelConnectionStatus")] - public IList TunnelConnectionStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.tunnelConnectionStatus")] + public System.Collections.Generic.IList TunnelConnectionStatus { get; private set; } /// - /// The Egress Bytes Transferred in this connection + /// Gets the egress bytes transferred in this connection. /// - [JsonProperty(PropertyName = "properties.egressBytesTransferred")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.egressBytesTransferred")] public long? EgressBytesTransferred { get; private set; } /// - /// The Ingress Bytes Transferred in this connection + /// Gets the ingress bytes transferred in this connection. /// - [JsonProperty(PropertyName = "properties.ingressBytesTransferred")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ingressBytesTransferred")] public long? IngressBytesTransferred { get; private set; } /// - /// The reference to peerings resource. + /// Gets or sets the reference to peerings resource. /// - [JsonProperty(PropertyName = "properties.peer")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peer")] public SubResource Peer { get; set; } /// - /// EnableBgp Flag + /// Gets or sets enableBgp flag /// - [JsonProperty(PropertyName = "properties.enableBgp")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableBgp")] public bool? EnableBgp { get; set; } /// - /// Gets or sets resource guid property of the - /// VirtualNetworkGatewayConnection resource + /// Gets or sets the resource GUID property of the + /// VirtualNetworkGatewayConnection resource. /// - [JsonProperty(PropertyName = "properties.resourceGuid")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// - /// Gets provisioning state of the VirtualNetworkGatewayConnection - /// resource Updating/Deleting/Failed + /// Gets the provisioning state of the VirtualNetworkGatewayConnection + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } /// /// Gets a unique read-only string that changes whenever the resource - /// is updated + /// is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (VirtualNetworkGateway1 == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetworkGateway1"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "VirtualNetworkGateway1"); } if (ConnectionType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ConnectionType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ConnectionType"); } if (this.VirtualNetworkGateway1 != null) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionStatus.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionStatus.cs index 2246e29e89999..2c3585457379a 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionStatus.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionStatus.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for VirtualNetworkGatewayConnectionStatus. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionType.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionType.cs index bda99c43aa06f..525326bb08890 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionType.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionType.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for VirtualNetworkGatewayConnectionType. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs index a9f507a946af1..b3d7ae02519ff 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// IpConfiguration for Virtual network gateway + /// IP configuration for virtual network gateway /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualNetworkGatewayIPConfiguration : SubResource { /// @@ -32,6 +26,21 @@ public VirtualNetworkGatewayIPConfiguration() { } /// Initializes a new instance of the /// VirtualNetworkGatewayIPConfiguration class. /// + /// The reference of the subnet resource. + /// The reference of the public IP + /// resource. + /// Resource ID. + /// The private IP allocation + /// method. Possible values are: 'Static' and 'Dynamic'. Possible + /// values include: 'Static', 'Dynamic' + /// The provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// The name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public VirtualNetworkGatewayIPConfiguration(SubResource subnet, SubResource publicIPAddress, string id = default(string), string privateIPAllocationMethod = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -44,57 +53,61 @@ public VirtualNetworkGatewayIPConfiguration() { } } /// - /// Gets or sets PrivateIP allocation method. Possible values include: - /// 'Static', 'Dynamic' + /// Gets or sets the private IP allocation method. Possible values + /// are: 'Static' and 'Dynamic'. Possible values include: 'Static', + /// 'Dynamic' /// - [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] public string PrivateIPAllocationMethod { get; set; } /// - /// Gets or sets the reference of the subnet resource + /// Gets or sets the reference of the subnet resource. /// - [JsonProperty(PropertyName = "properties.subnet")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] public SubResource Subnet { get; set; } /// - /// Gets or sets the reference of the PublicIP resource + /// Gets or sets the reference of the public IP resource. /// - [JsonProperty(PropertyName = "properties.publicIPAddress")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddress")] public SubResource PublicIPAddress { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the public IP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.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 + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (Subnet == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Subnet"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Subnet"); } if (PublicIPAddress == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "PublicIPAddress"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PublicIPAddress"); } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySku.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySku.cs index 1afd20d3a89ed..02f293f3a0229 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySku.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySku.cs @@ -2,19 +2,13 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// /// VirtualNetworkGatewaySku details @@ -29,6 +23,15 @@ public VirtualNetworkGatewaySku() { } /// /// Initializes a new instance of the VirtualNetworkGatewaySku class. /// + /// Gateway SKU name. Possible values are: 'Basic', + /// 'HighPerformance','Standard', and 'UltraPerformance'. Possible + /// values include: 'Basic', 'HighPerformance', 'Standard', + /// 'UltraPerformance' + /// Gateway SKU tier. Possible values are: 'Basic', + /// 'HighPerformance','Standard', and 'UltraPerformance'. Possible + /// values include: 'Basic', 'HighPerformance', 'Standard', + /// 'UltraPerformance' + /// The capacity. public VirtualNetworkGatewaySku(string name, string tier, int? capacity = default(int?)) { Name = name; @@ -37,39 +40,44 @@ public VirtualNetworkGatewaySku() { } } /// - /// Gateway sku name -Basic/HighPerformance/Standard/UltraPerformance. - /// Possible values include: 'Basic', 'HighPerformance', 'Standard', + /// Gets or sets gateway SKU name. Possible values are: 'Basic', + /// 'HighPerformance','Standard', and 'UltraPerformance'. Possible + /// values include: 'Basic', 'HighPerformance', 'Standard', /// 'UltraPerformance' /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// Gateway sku tier -Basic/HighPerformance/Standard/UltraPerformance. - /// Possible values include: 'Basic', 'HighPerformance', 'Standard', + /// Gets or sets gateway SKU tier. Possible values are: 'Basic', + /// 'HighPerformance','Standard', and 'UltraPerformance'. Possible + /// values include: 'Basic', 'HighPerformance', 'Standard', /// 'UltraPerformance' /// - [JsonProperty(PropertyName = "tier")] + [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] public string Tier { get; set; } /// - /// The capacity + /// Gets or sets the capacity. /// - [JsonProperty(PropertyName = "capacity")] + [Newtonsoft.Json.JsonProperty(PropertyName = "capacity")] public int? Capacity { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } if (Tier == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Tier"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Tier"); } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuName.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuName.cs index 40d1ffa70db0c..6e0ac5abb4d5d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuName.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuName.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for VirtualNetworkGatewaySkuName. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuTier.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuTier.cs index e08411afcd35d..ea97c0d44f214 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuTier.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuTier.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for VirtualNetworkGatewaySkuTier. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayType.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayType.cs index 29387f435ab32..30cd52ccd1da1 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayType.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayType.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for VirtualNetworkGatewayType. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeering.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeering.cs index 45bdd6d79c3f5..c2e997911db97 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeering.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeering.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// Peerings in a VirtualNework resource + /// Peerings in a virtual network resource. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualNetworkPeering : SubResource { /// @@ -30,6 +24,34 @@ public VirtualNetworkPeering() { } /// /// Initializes a new instance of the VirtualNetworkPeering class. /// + /// Resource ID. + /// Whether the VMs in the + /// linked virtual network space would be able to access all the VMs + /// in local Virtual network space. + /// Whether the forwarded traffic + /// from the VMs in the remote virtual network will be + /// allowed/disallowed. + /// If gateway links can be used in + /// remote virtual networking to link to this virtual network. + /// If remote gateways can be used on + /// this virtual network. If the flag is set to true, and + /// allowGatewayTransit on remote peering is also true, virtual + /// network will use gateways of remote virtual network for transit. + /// Only one peering can have this flag set to true. This flag cannot + /// be set if virtual network already has a gateway. + /// The reference of the remote + /// virtual network. + /// The status of the virtual network + /// peering. Possible values are 'Initiated', 'Connected', and + /// 'Disconnected'. Possible values include: 'Initiated', + /// 'Connected', 'Disconnected' + /// The provisioning state of the + /// resource. + /// The name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public VirtualNetworkPeering(string id = default(string), bool? allowVirtualNetworkAccess = default(bool?), bool? allowForwardedTraffic = default(bool?), bool? allowGatewayTransit = default(bool?), bool? useRemoteGateways = default(bool?), SubResource remoteVirtualNetwork = default(SubResource), string peeringState = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -46,67 +68,69 @@ public VirtualNetworkPeering() { } /// /// Gets or sets whether the VMs in the linked virtual network space - /// would be able to access all the VMs in local Virtual network space + /// would be able to access all the VMs in local Virtual network + /// space. /// - [JsonProperty(PropertyName = "properties.allowVirtualNetworkAccess")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowVirtualNetworkAccess")] public bool? AllowVirtualNetworkAccess { get; set; } /// /// Gets or sets whether the forwarded traffic from the VMs in the - /// remote virtual network will be allowed/disallowed + /// remote virtual network will be allowed/disallowed. /// - [JsonProperty(PropertyName = "properties.allowForwardedTraffic")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowForwardedTraffic")] public bool? AllowForwardedTraffic { get; set; } /// - /// Gets or sets if gatewayLinks can be used in remote virtual - /// network’s link to this virtual network + /// Gets or sets if gateway links can be used in remote virtual + /// networking to link to this virtual network. /// - [JsonProperty(PropertyName = "properties.allowGatewayTransit")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowGatewayTransit")] public bool? AllowGatewayTransit { get; set; } /// /// Gets or sets if remote gateways can be used on this virtual /// network. If the flag is set to true, and allowGatewayTransit on /// remote peering is also true, virtual network will use gateways of - /// remote virtual network for transit. Only 1 peering can have this - /// flag set to true. This flag cannot be set if virtual network + /// remote virtual network for transit. Only one peering can have + /// this flag set to true. This flag cannot be set if virtual network /// already has a gateway. /// - [JsonProperty(PropertyName = "properties.useRemoteGateways")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.useRemoteGateways")] public bool? UseRemoteGateways { get; set; } /// - /// Gets or sets the reference of the remote virtual network + /// Gets or sets the reference of the remote virtual network. /// - [JsonProperty(PropertyName = "properties.remoteVirtualNetwork")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.remoteVirtualNetwork")] public SubResource RemoteVirtualNetwork { get; set; } /// - /// Gets the status of the virtual network peering. Possible values - /// include: 'Initiated', 'Connected', 'Disconnected' + /// Gets or sets the status of the virtual network peering. Possible + /// values are 'Initiated', 'Connected', and 'Disconnected'. Possible + /// values include: 'Initiated', 'Connected', 'Disconnected' /// - [JsonProperty(PropertyName = "properties.peeringState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peeringState")] public string PeeringState { get; set; } /// - /// Gets provisioning state of the resource + /// Gets or sets the provisioning state of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource + /// resource group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeeringState.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeeringState.cs index ee6ed0ee3b830..75b43119ac948 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeeringState.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeeringState.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for VirtualNetworkPeeringState. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientConfiguration.cs index 9537876d38195..2f85b903b7208 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientConfiguration.cs @@ -2,22 +2,16 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// VpnClientConfiguration for P2S client + /// VpnClientConfiguration for P2S client. /// public partial class VpnClientConfiguration { @@ -29,7 +23,15 @@ public VpnClientConfiguration() { } /// /// Initializes a new instance of the VpnClientConfiguration class. /// - public VpnClientConfiguration(AddressSpace vpnClientAddressPool = default(AddressSpace), IList vpnClientRootCertificates = default(IList), IList vpnClientRevokedCertificates = default(IList)) + /// The reference of the address + /// space resource which represents Address space for P2S + /// VpnClient. + /// VpnClientRootCertificate + /// for virtual network gateway. + /// VpnClientRevokedCertificate + /// for Virtual network gateway. + public VpnClientConfiguration(AddressSpace vpnClientAddressPool = default(AddressSpace), System.Collections.Generic.IList vpnClientRootCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList vpnClientRevokedCertificates = default(System.Collections.Generic.IList)) { VpnClientAddressPool = vpnClientAddressPool; VpnClientRootCertificates = vpnClientRootCertificates; @@ -37,23 +39,24 @@ public VpnClientConfiguration() { } } /// - /// Gets or sets the reference of the Address space resource which + /// Gets or sets the reference of the address space resource which /// represents Address space for P2S VpnClient. /// - [JsonProperty(PropertyName = "vpnClientAddressPool")] + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnClientAddressPool")] public AddressSpace VpnClientAddressPool { get; set; } /// - /// VpnClientRootCertificate for Virtual network gateway. + /// Gets or sets vpnClientRootCertificate for virtual network gateway. /// - [JsonProperty(PropertyName = "vpnClientRootCertificates")] - public IList VpnClientRootCertificates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnClientRootCertificates")] + public System.Collections.Generic.IList VpnClientRootCertificates { get; set; } /// - /// VpnClientRevokedCertificate for Virtual network gateway. + /// Gets or sets vpnClientRevokedCertificate for Virtual network + /// gateway. /// - [JsonProperty(PropertyName = "vpnClientRevokedCertificates")] - public IList VpnClientRevokedCertificates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vpnClientRevokedCertificates")] + public System.Collections.Generic.IList VpnClientRevokedCertificates { get; set; } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientParameters.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientParameters.cs index 3894856ab01e5..2642891c850ac 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientParameters.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientParameters.cs @@ -2,19 +2,13 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// /// VpnClientParameters @@ -29,26 +23,32 @@ public VpnClientParameters() { } /// /// Initializes a new instance of the VpnClientParameters class. /// + /// VPN client Processor + /// Architecture. Possible values are: 'AMD64' and 'X86'. Possible + /// values include: 'Amd64', 'X86' public VpnClientParameters(string processorArchitecture) { ProcessorArchitecture = processorArchitecture; } /// - /// VPN client Processor Architecture -Amd64/X86. Possible values - /// include: 'Amd64', 'X86' + /// Gets or sets VPN client Processor Architecture. Possible values + /// are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86' /// - [JsonProperty(PropertyName = "ProcessorArchitecture")] + [Newtonsoft.Json.JsonProperty(PropertyName = "ProcessorArchitecture")] public string ProcessorArchitecture { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (ProcessorArchitecture == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ProcessorArchitecture"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ProcessorArchitecture"); } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRevokedCertificate.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRevokedCertificate.cs index 275172bef8390..980ac32111bc3 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRevokedCertificate.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRevokedCertificate.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// - /// VPN client revoked certificate of virtual network gateway + /// VPN client revoked certificate of virtual network gateway. /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VpnClientRevokedCertificate : SubResource { /// @@ -32,6 +26,17 @@ public VpnClientRevokedCertificate() { } /// Initializes a new instance of the VpnClientRevokedCertificate /// class. /// + /// Resource ID. + /// The revoked VPN client certificate + /// thumbprint. + /// The provisioning state of the VPN + /// client revoked certificate resource. Possible values are: + /// 'Updating', 'Deleting', and 'Failed'. + /// The name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public VpnClientRevokedCertificate(string id = default(string), string thumbprint = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -42,30 +47,31 @@ public VpnClientRevokedCertificate() { } } /// - /// Gets or sets the revoked Vpn client certificate thumbprint + /// Gets or sets the revoked VPN client certificate thumbprint. /// - [JsonProperty(PropertyName = "properties.thumbprint")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.thumbprint")] public string Thumbprint { get; set; } /// - /// Gets provisioning state of the VPN client revoked certificate - /// resource Updating/Deleting/Failed + /// Gets the provisioning state of the VPN client revoked certificate + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.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 + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRootCertificate.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRootCertificate.cs index 6fe0f3ac1d4a3..5e389c1f28dad 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRootCertificate.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRootCertificate.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; /// /// VPN client root certificate of virtual network gateway /// - [JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VpnClientRootCertificate : SubResource { /// @@ -30,6 +24,16 @@ public VpnClientRootCertificate() { } /// /// Initializes a new instance of the VpnClientRootCertificate class. /// + /// The certificate public data. + /// Resource ID. + /// The provisioning state of the VPN + /// client root certificate resource. Possible values are: + /// 'Updating', 'Deleting', and 'Failed'. + /// The name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public VpnClientRootCertificate(string publicCertData, string id = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -40,40 +44,44 @@ public VpnClientRootCertificate() { } } /// - /// Gets or sets the certificate public data + /// Gets or sets the certificate public data. /// - [JsonProperty(PropertyName = "properties.publicCertData")] + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicCertData")] public string PublicCertData { get; set; } /// - /// Gets provisioning state of the VPN client root certificate - /// resource Updating/Deleting/Failed + /// Gets the provisioning state of the VPN client root certificate + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [Newtonsoft.Json.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 + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// - [JsonProperty(PropertyName = "name")] + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// - [JsonProperty(PropertyName = "etag")] + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (PublicCertData == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "PublicCertData"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PublicCertData"); } } } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnType.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnType.cs index 65c2663915561..ba5c7ac470990 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnType.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnType.cs @@ -2,15 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; /// /// Defines values for VpnType. diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperations.cs index 137300c6a05d5..1e8cb6faaec85 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperations.cs @@ -2,32 +2,21 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; using System.Linq; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using Microsoft.Rest.Azure; using Models; /// /// NetworkInterfacesOperations operations. /// - internal partial class NetworkInterfacesOperations : IServiceOperations, INetworkInterfacesOperations + internal partial class NetworkInterfacesOperations : Microsoft.Rest.IServiceOperations, INetworkInterfacesOperations { /// /// Initializes a new instance of the NetworkInterfacesOperations class. @@ -35,11 +24,14 @@ internal partial class NetworkInterfacesOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal NetworkInterfacesOperations(NetworkManagementClient client) { if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } this.Client = client; } @@ -50,7 +42,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The delete netwokInterface operation deletes the specified netwokInterface. + /// Deletes the specified network interface. /// /// /// The name of the resource group. @@ -64,16 +56,16 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, networkInterfaceName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete netwokInterface operation deletes the specified netwokInterface. + /// Deletes the specified network interface. /// /// /// The name of the resource group. @@ -87,63 +79,69 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkInterfaceName}", Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -176,30 +174,35 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -209,7 +212,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -218,14 +221,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Get network interface operation retrieves information about the - /// specified network interface. + /// Gets information about the specified network interface. /// /// /// The name of the resource group. @@ -234,7 +236,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// The name of the network interface. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// Headers that will be added to request. @@ -242,68 +244,77 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkInterfaceName}", Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (expand != null) { - _queryParameters.Add(string.Format("$expand={0}", Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -336,43 +347,43 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -382,7 +393,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -395,27 +406,27 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Put NetworkInterface operation creates/updates a networkInterface + /// Creates or updates a network interface. /// /// /// The name of the resource group. @@ -424,7 +435,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// The name of the network interface. /// /// - /// Parameters supplied to the create/update NetworkInterface operation + /// Parameters supplied to the create or update network interface operation. /// /// /// The headers that will be added to request. @@ -432,10 +443,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, networkInterfaceName, parameters, customHeaders, cancellationToken); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, @@ -443,7 +454,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) } /// - /// The Put NetworkInterface operation creates/updates a networkInterface + /// Creates or updates a network interface. /// /// /// The name of the resource group. @@ -452,7 +463,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// The name of the network interface. /// /// - /// Parameters supplied to the create/update NetworkInterface operation + /// Parameters supplied to the create or update network interface operation. /// /// /// Headers that will be added to request. @@ -460,68 +471,77 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkInterfaceName}", Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -547,9 +567,9 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) string _requestContent = null; if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) @@ -560,43 +580,43 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 201 && (int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -606,7 +626,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -619,16 +639,16 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -637,28 +657,28 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine from a virtual machine scale set. + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. /// /// /// The name of the resource group. @@ -675,69 +695,78 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListVirtualMachineScaleSetVMNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListVirtualMachineScaleSetVMNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualMachineScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); } if (virtualmachineIndex == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualmachineIndex"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualmachineIndex"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); tracingParameters.Add("virtualmachineIndex", virtualmachineIndex); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetVMNetworkInterfaces", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetVMNetworkInterfaces", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualMachineScaleSetName}", Uri.EscapeDataString(virtualMachineScaleSetName)); - _url = _url.Replace("{virtualmachineIndex}", Uri.EscapeDataString(virtualmachineIndex)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); + _url = _url.Replace("{virtualmachineIndex}", System.Uri.EscapeDataString(virtualmachineIndex)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -770,43 +799,43 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -816,7 +845,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -829,28 +858,27 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine scale set. + /// Gets all network interfaces in a virtual machine scale set. /// /// /// The name of the resource group. @@ -864,63 +892,72 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListVirtualMachineScaleSetNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListVirtualMachineScaleSetNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualMachineScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetNetworkInterfaces", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetNetworkInterfaces", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualMachineScaleSetName}", Uri.EscapeDataString(virtualMachineScaleSetName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -953,43 +990,43 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -999,7 +1036,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1012,28 +1049,27 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Get network interface operation retrieves information about the - /// specified network interface in a virtual machine scale set. + /// Get the specified network interface in a virtual machine scale set. /// /// /// The name of the resource group. @@ -1048,7 +1084,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// The name of the network interface. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// Headers that will be added to request. @@ -1056,80 +1092,89 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetVirtualMachineScaleSetNetworkInterfaceWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetVirtualMachineScaleSetNetworkInterfaceWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualMachineScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); } if (virtualmachineIndex == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualmachineIndex"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualmachineIndex"); } if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); tracingParameters.Add("virtualmachineIndex", virtualmachineIndex); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVirtualMachineScaleSetNetworkInterface", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetVirtualMachineScaleSetNetworkInterface", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualMachineScaleSetName}", Uri.EscapeDataString(virtualMachineScaleSetName)); - _url = _url.Replace("{virtualmachineIndex}", Uri.EscapeDataString(virtualmachineIndex)); - _url = _url.Replace("{networkInterfaceName}", Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); + _url = _url.Replace("{virtualmachineIndex}", System.Uri.EscapeDataString(virtualmachineIndex)); + _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (expand != null) { - _queryParameters.Add(string.Format("$expand={0}", Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1162,43 +1207,43 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1208,7 +1253,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1221,28 +1266,27 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a subscription. + /// Gets all network interfaces in a subscription. /// /// /// Headers that will be added to request. @@ -1250,51 +1294,60 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1327,43 +1380,43 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1373,7 +1426,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1386,28 +1439,27 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a resource group. + /// Gets all network interfaces in a resource group. /// /// /// The name of the resource group. @@ -1418,57 +1470,66 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1501,43 +1562,43 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1547,7 +1608,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1560,28 +1621,27 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The get effective routetable operation retrieves all the route tables - /// applied on a networkInterface. + /// Gets all route tables applied to a network interface. /// /// /// The name of the resource group. @@ -1595,17 +1655,16 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> GetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginGetEffectiveRouteTableWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetEffectiveRouteTableWithHttpMessagesAsync( resourceGroupName, networkInterfaceName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The get effective routetable operation retrieves all the route tables - /// applied on a networkInterface. + /// Gets all route tables applied to a network interface. /// /// /// The name of the resource group. @@ -1619,63 +1678,72 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetEffectiveRouteTable", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetEffectiveRouteTable", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkInterfaceName}", Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1708,43 +1776,43 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1754,7 +1822,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1767,28 +1835,27 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The list effective network security group operation retrieves all the - /// network security groups applied on a networkInterface. + /// Gets all network security groups applied to a network interface. /// /// /// The name of the resource group. @@ -1802,17 +1869,16 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync( resourceGroupName, networkInterfaceName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The list effective network security group operation retrieves all the - /// network security groups applied on a networkInterface. + /// Gets all network security groups applied to a network interface. /// /// /// The name of the resource group. @@ -1826,63 +1892,72 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (networkInterfaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListEffectiveNetworkSecurityGroups", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListEffectiveNetworkSecurityGroups", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkInterfaceName}", Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1915,43 +1990,43 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1961,7 +2036,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1974,28 +2049,28 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine from a virtual machine scale set. + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. /// /// /// The NextLink from the previous successful call to List operation. @@ -2006,43 +2081,52 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetVMNetworkInterfacesNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetVMNetworkInterfacesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -2075,43 +2159,43 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2121,7 +2205,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2134,28 +2218,27 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine scale set. + /// Gets all network interfaces in a virtual machine scale set. /// /// /// The NextLink from the previous successful call to List operation. @@ -2166,43 +2249,52 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListVirtualMachineScaleSetNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListVirtualMachineScaleSetNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetNetworkInterfacesNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetNetworkInterfacesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -2235,43 +2327,43 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2281,7 +2373,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2294,28 +2386,27 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a subscription. + /// Gets all network interfaces in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -2326,43 +2417,52 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -2395,43 +2495,43 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2441,7 +2541,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2454,28 +2554,27 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a resource group. + /// Gets all network interfaces in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -2486,43 +2585,52 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -2555,43 +2663,43 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2601,7 +2709,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2614,21 +2722,21 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperationsExtensions.cs index b563aa1737ab7..dd3d6b6667496 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperationsExtensions.cs @@ -2,20 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; + using Microsoft.Rest.Azure; + using Models; /// /// Extension methods for NetworkInterfacesOperations. @@ -23,7 +18,7 @@ namespace Microsoft.Azure.Management.Network public static partial class NetworkInterfacesOperationsExtensions { /// - /// The delete netwokInterface operation deletes the specified netwokInterface. + /// Deletes the specified network interface. /// /// /// The operations group for this extension method. @@ -36,11 +31,11 @@ public static partial class NetworkInterfacesOperationsExtensions /// public static void Delete(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) { - Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).DeleteAsync(resourceGroupName, networkInterfaceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).DeleteAsync(resourceGroupName, networkInterfaceName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete netwokInterface operation deletes the specified netwokInterface. + /// Deletes the specified network interface. /// /// /// The operations group for this extension method. @@ -54,13 +49,13 @@ public static void Delete(this INetworkInterfacesOperations operations, string r /// /// The cancellation token. /// - public static async Task DeleteAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false); } /// - /// The delete netwokInterface operation deletes the specified netwokInterface. + /// Deletes the specified network interface. /// /// /// The operations group for this extension method. @@ -73,11 +68,11 @@ public static void Delete(this INetworkInterfacesOperations operations, string r /// public static void BeginDelete(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) { - Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginDeleteAsync(resourceGroupName, networkInterfaceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginDeleteAsync(resourceGroupName, networkInterfaceName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete netwokInterface operation deletes the specified netwokInterface. + /// Deletes the specified network interface. /// /// /// The operations group for this extension method. @@ -91,14 +86,13 @@ public static void BeginDelete(this INetworkInterfacesOperations operations, str /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Get network interface operation retrieves information about the - /// specified network interface. + /// Gets information about the specified network interface. /// /// /// The operations group for this extension method. @@ -110,16 +104,15 @@ public static void BeginDelete(this INetworkInterfacesOperations operations, str /// The name of the network interface. /// /// - /// expand references resources. + /// Expands referenced resources. /// public static NetworkInterface Get(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, string expand = default(string)) { - return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).GetAsync(resourceGroupName, networkInterfaceName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).GetAsync(resourceGroupName, networkInterfaceName, expand), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get network interface operation retrieves information about the - /// specified network interface. + /// Gets information about the specified network interface. /// /// /// The operations group for this extension method. @@ -131,12 +124,12 @@ public static void BeginDelete(this INetworkInterfacesOperations operations, str /// The name of the network interface. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// The cancellation token. /// - public static async Task GetAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, expand, null, cancellationToken).ConfigureAwait(false)) { @@ -145,7 +138,7 @@ public static void BeginDelete(this INetworkInterfacesOperations operations, str } /// - /// The Put NetworkInterface operation creates/updates a networkInterface + /// Creates or updates a network interface. /// /// /// The operations group for this extension method. @@ -157,15 +150,15 @@ public static void BeginDelete(this INetworkInterfacesOperations operations, str /// The name of the network interface. /// /// - /// Parameters supplied to the create/update NetworkInterface operation + /// Parameters supplied to the create or update network interface operation. /// public static NetworkInterface CreateOrUpdate(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters) { - return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).CreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).CreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put NetworkInterface operation creates/updates a networkInterface + /// Creates or updates a network interface. /// /// /// The operations group for this extension method. @@ -177,12 +170,12 @@ public static NetworkInterface CreateOrUpdate(this INetworkInterfacesOperations /// The name of the network interface. /// /// - /// Parameters supplied to the create/update NetworkInterface operation + /// Parameters supplied to the create or update network interface operation. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -191,7 +184,7 @@ public static NetworkInterface CreateOrUpdate(this INetworkInterfacesOperations } /// - /// The Put NetworkInterface operation creates/updates a networkInterface + /// Creates or updates a network interface. /// /// /// The operations group for this extension method. @@ -203,15 +196,15 @@ public static NetworkInterface CreateOrUpdate(this INetworkInterfacesOperations /// The name of the network interface. /// /// - /// Parameters supplied to the create/update NetworkInterface operation + /// Parameters supplied to the create or update network interface operation. /// public static NetworkInterface BeginCreateOrUpdate(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters) { - return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put NetworkInterface operation creates/updates a networkInterface + /// Creates or updates a network interface. /// /// /// The operations group for this extension method. @@ -223,12 +216,12 @@ public static NetworkInterface BeginCreateOrUpdate(this INetworkInterfacesOperat /// The name of the network interface. /// /// - /// Parameters supplied to the create/update NetworkInterface operation + /// Parameters supplied to the create or update network interface operation. /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -237,8 +230,8 @@ public static NetworkInterface BeginCreateOrUpdate(this INetworkInterfacesOperat } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine from a virtual machine scale set. + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. /// /// /// The operations group for this extension method. @@ -252,14 +245,14 @@ public static NetworkInterface BeginCreateOrUpdate(this INetworkInterfacesOperat /// /// The virtual machine index. /// - public static IPage ListVirtualMachineScaleSetVMNetworkInterfaces(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex) + public static Microsoft.Rest.Azure.IPage ListVirtualMachineScaleSetVMNetworkInterfaces(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex) { - return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListVirtualMachineScaleSetVMNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListVirtualMachineScaleSetVMNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine from a virtual machine scale set. + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. /// /// /// The operations group for this extension method. @@ -276,7 +269,7 @@ public static IPage ListVirtualMachineScaleSetVMNetworkInterfa /// /// The cancellation token. /// - public static async Task> ListVirtualMachineScaleSetVMNetworkInterfacesAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListVirtualMachineScaleSetVMNetworkInterfacesAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListVirtualMachineScaleSetVMNetworkInterfacesWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, null, cancellationToken).ConfigureAwait(false)) { @@ -285,8 +278,7 @@ public static IPage ListVirtualMachineScaleSetVMNetworkInterfa } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine scale set. + /// Gets all network interfaces in a virtual machine scale set. /// /// /// The operations group for this extension method. @@ -297,14 +289,13 @@ public static IPage ListVirtualMachineScaleSetVMNetworkInterfa /// /// The name of the virtual machine scale set. /// - public static IPage ListVirtualMachineScaleSetNetworkInterfaces(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName) + public static Microsoft.Rest.Azure.IPage ListVirtualMachineScaleSetNetworkInterfaces(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName) { - return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListVirtualMachineScaleSetNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListVirtualMachineScaleSetNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine scale set. + /// Gets all network interfaces in a virtual machine scale set. /// /// /// The operations group for this extension method. @@ -318,7 +309,7 @@ public static IPage ListVirtualMachineScaleSetNetworkInterface /// /// The cancellation token. /// - public static async Task> ListVirtualMachineScaleSetNetworkInterfacesAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListVirtualMachineScaleSetNetworkInterfacesAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListVirtualMachineScaleSetNetworkInterfacesWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, null, cancellationToken).ConfigureAwait(false)) { @@ -327,8 +318,7 @@ public static IPage ListVirtualMachineScaleSetNetworkInterface } /// - /// The Get network interface operation retrieves information about the - /// specified network interface in a virtual machine scale set. + /// Get the specified network interface in a virtual machine scale set. /// /// /// The operations group for this extension method. @@ -346,16 +336,15 @@ public static IPage ListVirtualMachineScaleSetNetworkInterface /// The name of the network interface. /// /// - /// expand references resources. + /// Expands referenced resources. /// public static NetworkInterface GetVirtualMachineScaleSetNetworkInterface(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string)) { - return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).GetVirtualMachineScaleSetNetworkInterfaceAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).GetVirtualMachineScaleSetNetworkInterfaceAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get network interface operation retrieves information about the - /// specified network interface in a virtual machine scale set. + /// Get the specified network interface in a virtual machine scale set. /// /// /// The operations group for this extension method. @@ -373,12 +362,12 @@ public static IPage ListVirtualMachineScaleSetNetworkInterface /// The name of the network interface. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// The cancellation token. /// - public static async Task GetVirtualMachineScaleSetNetworkInterfaceAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetVirtualMachineScaleSetNetworkInterfaceAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetVirtualMachineScaleSetNetworkInterfaceWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand, null, cancellationToken).ConfigureAwait(false)) { @@ -387,20 +376,18 @@ public static IPage ListVirtualMachineScaleSetNetworkInterface } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a subscription. + /// Gets all network interfaces in a subscription. /// /// /// The operations group for this extension method. /// - public static IPage ListAll(this INetworkInterfacesOperations operations) + public static Microsoft.Rest.Azure.IPage ListAll(this INetworkInterfacesOperations operations) { - return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListAllAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a subscription. + /// Gets all network interfaces in a subscription. /// /// /// The operations group for this extension method. @@ -408,7 +395,7 @@ public static IPage ListAll(this INetworkInterfacesOperations /// /// The cancellation token. /// - public static async Task> ListAllAsync(this INetworkInterfacesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllAsync(this INetworkInterfacesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -417,8 +404,7 @@ public static IPage ListAll(this INetworkInterfacesOperations } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a resource group. + /// Gets all network interfaces in a resource group. /// /// /// The operations group for this extension method. @@ -426,14 +412,13 @@ public static IPage ListAll(this INetworkInterfacesOperations /// /// The name of the resource group. /// - public static IPage List(this INetworkInterfacesOperations operations, string resourceGroupName) + public static Microsoft.Rest.Azure.IPage List(this INetworkInterfacesOperations operations, string resourceGroupName) { - return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a resource group. + /// Gets all network interfaces in a resource group. /// /// /// The operations group for this extension method. @@ -444,7 +429,7 @@ public static IPage List(this INetworkInterfacesOperations ope /// /// The cancellation token. /// - public static async Task> ListAsync(this INetworkInterfacesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this INetworkInterfacesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { @@ -453,8 +438,7 @@ public static IPage List(this INetworkInterfacesOperations ope } /// - /// The get effective routetable operation retrieves all the route tables - /// applied on a networkInterface. + /// Gets all route tables applied to a network interface. /// /// /// The operations group for this extension method. @@ -467,12 +451,11 @@ public static IPage List(this INetworkInterfacesOperations ope /// public static EffectiveRouteListResult GetEffectiveRouteTable(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) { - return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).GetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).GetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The get effective routetable operation retrieves all the route tables - /// applied on a networkInterface. + /// Gets all route tables applied to a network interface. /// /// /// The operations group for this extension method. @@ -486,7 +469,7 @@ public static EffectiveRouteListResult GetEffectiveRouteTable(this INetworkInter /// /// The cancellation token. /// - public static async Task GetEffectiveRouteTableAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetEffectiveRouteTableAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetEffectiveRouteTableWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { @@ -495,8 +478,7 @@ public static EffectiveRouteListResult GetEffectiveRouteTable(this INetworkInter } /// - /// The get effective routetable operation retrieves all the route tables - /// applied on a networkInterface. + /// Gets all route tables applied to a network interface. /// /// /// The operations group for this extension method. @@ -509,12 +491,11 @@ public static EffectiveRouteListResult GetEffectiveRouteTable(this INetworkInter /// public static EffectiveRouteListResult BeginGetEffectiveRouteTable(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) { - return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The get effective routetable operation retrieves all the route tables - /// applied on a networkInterface. + /// Gets all route tables applied to a network interface. /// /// /// The operations group for this extension method. @@ -528,7 +509,7 @@ public static EffectiveRouteListResult BeginGetEffectiveRouteTable(this INetwork /// /// The cancellation token. /// - public static async Task BeginGetEffectiveRouteTableAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginGetEffectiveRouteTableAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginGetEffectiveRouteTableWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { @@ -537,8 +518,7 @@ public static EffectiveRouteListResult BeginGetEffectiveRouteTable(this INetwork } /// - /// The list effective network security group operation retrieves all the - /// network security groups applied on a networkInterface. + /// Gets all network security groups applied to a network interface. /// /// /// The operations group for this extension method. @@ -551,12 +531,11 @@ public static EffectiveRouteListResult BeginGetEffectiveRouteTable(this INetwork /// public static EffectiveNetworkSecurityGroupListResult ListEffectiveNetworkSecurityGroups(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) { - return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list effective network security group operation retrieves all the - /// network security groups applied on a networkInterface. + /// Gets all network security groups applied to a network interface. /// /// /// The operations group for this extension method. @@ -570,7 +549,7 @@ public static EffectiveNetworkSecurityGroupListResult ListEffectiveNetworkSecuri /// /// The cancellation token. /// - public static async Task ListEffectiveNetworkSecurityGroupsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task ListEffectiveNetworkSecurityGroupsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { @@ -579,8 +558,7 @@ public static EffectiveNetworkSecurityGroupListResult ListEffectiveNetworkSecuri } /// - /// The list effective network security group operation retrieves all the - /// network security groups applied on a networkInterface. + /// Gets all network security groups applied to a network interface. /// /// /// The operations group for this extension method. @@ -593,12 +571,11 @@ public static EffectiveNetworkSecurityGroupListResult ListEffectiveNetworkSecuri /// public static EffectiveNetworkSecurityGroupListResult BeginListEffectiveNetworkSecurityGroups(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) { - return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list effective network security group operation retrieves all the - /// network security groups applied on a networkInterface. + /// Gets all network security groups applied to a network interface. /// /// /// The operations group for this extension method. @@ -612,7 +589,7 @@ public static EffectiveNetworkSecurityGroupListResult BeginListEffectiveNetworkS /// /// The cancellation token. /// - public static async Task BeginListEffectiveNetworkSecurityGroupsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginListEffectiveNetworkSecurityGroupsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { @@ -621,8 +598,8 @@ public static EffectiveNetworkSecurityGroupListResult BeginListEffectiveNetworkS } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine from a virtual machine scale set. + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. /// /// /// The operations group for this extension method. @@ -630,14 +607,14 @@ public static EffectiveNetworkSecurityGroupListResult BeginListEffectiveNetworkS /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListVirtualMachineScaleSetVMNetworkInterfacesNext(this INetworkInterfacesOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListVirtualMachineScaleSetVMNetworkInterfacesNext(this INetworkInterfacesOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListVirtualMachineScaleSetVMNetworkInterfacesNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListVirtualMachineScaleSetVMNetworkInterfacesNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine from a virtual machine scale set. + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. /// /// /// The operations group for this extension method. @@ -648,7 +625,7 @@ public static IPage ListVirtualMachineScaleSetVMNetworkInterfa /// /// The cancellation token. /// - public static async Task> ListVirtualMachineScaleSetVMNetworkInterfacesNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListVirtualMachineScaleSetVMNetworkInterfacesNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -657,8 +634,7 @@ public static IPage ListVirtualMachineScaleSetVMNetworkInterfa } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine scale set. + /// Gets all network interfaces in a virtual machine scale set. /// /// /// The operations group for this extension method. @@ -666,14 +642,13 @@ public static IPage ListVirtualMachineScaleSetVMNetworkInterfa /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListVirtualMachineScaleSetNetworkInterfacesNext(this INetworkInterfacesOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListVirtualMachineScaleSetNetworkInterfacesNext(this INetworkInterfacesOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListVirtualMachineScaleSetNetworkInterfacesNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListVirtualMachineScaleSetNetworkInterfacesNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine scale set. + /// Gets all network interfaces in a virtual machine scale set. /// /// /// The operations group for this extension method. @@ -684,7 +659,7 @@ public static IPage ListVirtualMachineScaleSetNetworkInterface /// /// The cancellation token. /// - public static async Task> ListVirtualMachineScaleSetNetworkInterfacesNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListVirtualMachineScaleSetNetworkInterfacesNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListVirtualMachineScaleSetNetworkInterfacesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -693,8 +668,7 @@ public static IPage ListVirtualMachineScaleSetNetworkInterface } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a subscription. + /// Gets all network interfaces in a subscription. /// /// /// The operations group for this extension method. @@ -702,14 +676,13 @@ public static IPage ListVirtualMachineScaleSetNetworkInterface /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListAllNext(this INetworkInterfacesOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListAllNext(this INetworkInterfacesOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListAllNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListAllNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a subscription. + /// Gets all network interfaces in a subscription. /// /// /// The operations group for this extension method. @@ -720,7 +693,7 @@ public static IPage ListAllNext(this INetworkInterfacesOperati /// /// The cancellation token. /// - public static async Task> ListAllNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -729,8 +702,7 @@ public static IPage ListAllNext(this INetworkInterfacesOperati } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a resource group. + /// Gets all network interfaces in a resource group. /// /// /// The operations group for this extension method. @@ -738,14 +710,13 @@ public static IPage ListAllNext(this INetworkInterfacesOperati /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this INetworkInterfacesOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListNext(this INetworkInterfacesOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a resource group. + /// Gets all network interfaces in a resource group. /// /// /// The operations group for this extension method. @@ -756,7 +727,7 @@ public static IPage ListNext(this INetworkInterfacesOperations /// /// The cancellation token. /// - public static async Task> ListNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClient.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClient.cs index a5b6bc85e2b08..94225d0bb2413 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClient.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClient.cs @@ -2,26 +2,14 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; using System.Linq; - using System.Collections.Generic; - using System.Diagnostics; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using Microsoft.Rest.Azure; using Models; @@ -32,37 +20,37 @@ namespace Microsoft.Azure.Management.Network /// relationship between an end user and the Microsoft Azure Networks /// service. /// - public partial class NetworkManagementClient : ServiceClient, INetworkManagementClient, IAzureClient + public partial class NetworkManagementClient : Microsoft.Rest.ServiceClient, INetworkManagementClient, IAzureClient { /// /// The base URI of the service. /// - public Uri BaseUri { get; set; } + public System.Uri BaseUri { get; set; } /// /// Gets or sets json serialization settings. /// - public JsonSerializerSettings SerializationSettings { get; private set; } + public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public JsonSerializerSettings DeserializationSettings { get; private set; } + public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } /// - /// Gets Azure subscription credentials. + /// Credentials needed for the client to connect to Azure. /// - public ServiceClientCredentials Credentials { get; private set; } + public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } /// - /// Gets subscription credentials which uniquely identify Microsoft Azure + /// The subscription credentials which uniquely identify the Microsoft Azure /// subscription. The subscription ID forms part of the URI for every service /// call. /// public string SubscriptionId { get; set; } /// - /// Client Api Version. + /// Client API version. /// public string ApiVersion { get; private set; } @@ -184,7 +172,7 @@ public partial class NetworkManagementClient : ServiceClient /// Optional. The delegating handlers to add to the http client pipeline. /// - protected NetworkManagementClient(params DelegatingHandler[] handlers) : base(handlers) + protected NetworkManagementClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { this.Initialize(); } @@ -198,7 +186,7 @@ protected NetworkManagementClient(params DelegatingHandler[] handlers) : base(ha /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected NetworkManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected NetworkManagementClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { this.Initialize(); } @@ -212,11 +200,14 @@ protected NetworkManagementClient(HttpClientHandler rootHandler, params Delegati /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected NetworkManagementClient(Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + /// + /// Thrown when a required parameter is null + /// + protected NetworkManagementClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { - throw new ArgumentNullException("baseUri"); + throw new System.ArgumentNullException("baseUri"); } this.BaseUri = baseUri; } @@ -233,11 +224,14 @@ protected NetworkManagementClient(Uri baseUri, params DelegatingHandler[] handle /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected NetworkManagementClient(Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + /// + /// Thrown when a required parameter is null + /// + protected NetworkManagementClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { - throw new ArgumentNullException("baseUri"); + throw new System.ArgumentNullException("baseUri"); } this.BaseUri = baseUri; } @@ -246,16 +240,19 @@ protected NetworkManagementClient(Uri baseUri, HttpClientHandler rootHandler, pa /// Initializes a new instance of the NetworkManagementClient class. /// /// - /// Required. Gets Azure subscription credentials. + /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - public NetworkManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + /// + /// Thrown when a required parameter is null + /// + public NetworkManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { - throw new ArgumentNullException("credentials"); + throw new System.ArgumentNullException("credentials"); } this.Credentials = credentials; if (this.Credentials != null) @@ -268,7 +265,7 @@ public NetworkManagementClient(ServiceClientCredentials credentials, params Dele /// Initializes a new instance of the NetworkManagementClient class. /// /// - /// Required. Gets Azure subscription credentials. + /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. @@ -276,11 +273,14 @@ public NetworkManagementClient(ServiceClientCredentials credentials, params Dele /// /// Optional. The delegating handlers to add to the http client pipeline. /// - public NetworkManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + /// + /// Thrown when a required parameter is null + /// + public NetworkManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { - throw new ArgumentNullException("credentials"); + throw new System.ArgumentNullException("credentials"); } this.Credentials = credentials; if (this.Credentials != null) @@ -296,20 +296,23 @@ public NetworkManagementClient(ServiceClientCredentials credentials, HttpClientH /// Optional. The base URI of the service. /// /// - /// Required. Gets Azure subscription credentials. + /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - public NetworkManagementClient(Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + /// + /// Thrown when a required parameter is null + /// + public NetworkManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { - throw new ArgumentNullException("baseUri"); + throw new System.ArgumentNullException("baseUri"); } if (credentials == null) { - throw new ArgumentNullException("credentials"); + throw new System.ArgumentNullException("credentials"); } this.BaseUri = baseUri; this.Credentials = credentials; @@ -326,7 +329,7 @@ public NetworkManagementClient(Uri baseUri, ServiceClientCredentials credentials /// Optional. The base URI of the service. /// /// - /// Required. Gets Azure subscription credentials. + /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. @@ -334,15 +337,18 @@ public NetworkManagementClient(Uri baseUri, ServiceClientCredentials credentials /// /// Optional. The delegating handlers to add to the http client pipeline. /// - public NetworkManagementClient(Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + /// + /// Thrown when a required parameter is null + /// + public NetworkManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { - throw new ArgumentNullException("baseUri"); + throw new System.ArgumentNullException("baseUri"); } if (credentials == null) { - throw new ArgumentNullException("credentials"); + throw new System.ArgumentNullException("credentials"); } this.BaseUri = baseUri; this.Credentials = credentials; @@ -352,6 +358,10 @@ public NetworkManagementClient(Uri baseUri, ServiceClientCredentials credentials } } + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); /// /// Initializes client properties. /// @@ -376,45 +386,46 @@ private void Initialize() this.VirtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionsOperations(this); this.VirtualNetworkGateways = new VirtualNetworkGatewaysOperations(this); this.VirtualNetworks = new VirtualNetworksOperations(this); - this.BaseUri = new Uri("https://management.azure.com"); + this.BaseUri = new System.Uri("https://management.azure.com"); this.ApiVersion = "2016-09-01"; this.AcceptLanguage = "en-US"; this.LongRunningOperationRetryTimeout = 30; this.GenerateClientRequestId = true; - SerializationSettings = new JsonSerializerSettings + SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings { - Formatting = Formatting.Indented, - DateFormatHandling = DateFormatHandling.IsoDateFormat, - DateTimeZoneHandling = DateTimeZoneHandling.Utc, - NullValueHandling = NullValueHandling.Ignore, - ReferenceLoopHandling = ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings = new JsonSerializerSettings + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { - DateFormatHandling = DateFormatHandling.IsoDateFormat, - DateTimeZoneHandling = DateTimeZoneHandling.Utc, - NullValueHandling = NullValueHandling.Ignore, - ReferenceLoopHandling = ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; - DeserializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + CustomInitialize(); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); } /// /// Checks whether a domain name in the cloudapp.net zone is available for use. /// /// - /// The location of the domain name + /// The location of the domain name. /// /// /// The domain name to be verified. It must conform to the following regular @@ -426,62 +437,71 @@ private void Initialize() /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> CheckDnsNameAvailabilityWithHttpMessagesAsync(string location, string domainNameLabel = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckDnsNameAvailabilityWithHttpMessagesAsync(string location, string domainNameLabel = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (this.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.ApiVersion"); } if (this.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("domainNameLabel", domainNameLabel); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckDnsNameAvailability", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckDnsNameAvailability", tracingParameters); } // Construct URL var _baseUrl = this.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability").ToString(); - _url = _url.Replace("{location}", Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (domainNameLabel != null) { - _queryParameters.Add(string.Format("domainNameLabel={0}", Uri.EscapeDataString(domainNameLabel))); + _queryParameters.Add(string.Format("domainNameLabel={0}", System.Uri.EscapeDataString(domainNameLabel))); } if (this.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.AcceptLanguage != null) { @@ -514,43 +534,43 @@ private void Initialize() // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -560,7 +580,7 @@ private void Initialize() throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -573,21 +593,21 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClientExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClientExtensions.cs index 431d5a9de1381..10454e22c62f5 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClientExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClientExtensions.cs @@ -2,20 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; + using Microsoft.Rest.Azure; + using Models; /// /// Extension methods for NetworkManagementClient. @@ -29,7 +24,7 @@ public static partial class NetworkManagementClientExtensions /// The operations group for this extension method. /// /// - /// The location of the domain name + /// The location of the domain name. /// /// /// The domain name to be verified. It must conform to the following regular @@ -37,7 +32,7 @@ public static partial class NetworkManagementClientExtensions /// public static DnsNameAvailabilityResult CheckDnsNameAvailability(this INetworkManagementClient operations, string location, string domainNameLabel = default(string)) { - return Task.Factory.StartNew(s => ((INetworkManagementClient)s).CheckDnsNameAvailabilityAsync(location, domainNameLabel), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkManagementClient)s).CheckDnsNameAvailabilityAsync(location, domainNameLabel), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -47,7 +42,7 @@ public static partial class NetworkManagementClientExtensions /// The operations group for this extension method. /// /// - /// The location of the domain name + /// The location of the domain name. /// /// /// The domain name to be verified. It must conform to the following regular @@ -56,7 +51,7 @@ public static partial class NetworkManagementClientExtensions /// /// The cancellation token. /// - public static async Task CheckDnsNameAvailabilityAsync(this INetworkManagementClient operations, string location, string domainNameLabel = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task CheckDnsNameAvailabilityAsync(this INetworkManagementClient operations, string location, string domainNameLabel = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CheckDnsNameAvailabilityWithHttpMessagesAsync(location, domainNameLabel, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperations.cs index b2f92d57dfbd1..4a6aa71c1af49 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperations.cs @@ -2,32 +2,21 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; using System.Linq; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using Microsoft.Rest.Azure; using Models; /// /// NetworkSecurityGroupsOperations operations. /// - internal partial class NetworkSecurityGroupsOperations : IServiceOperations, INetworkSecurityGroupsOperations + internal partial class NetworkSecurityGroupsOperations : Microsoft.Rest.IServiceOperations, INetworkSecurityGroupsOperations { /// /// Initializes a new instance of the NetworkSecurityGroupsOperations class. @@ -35,11 +24,14 @@ internal partial class NetworkSecurityGroupsOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } this.Client = client; } @@ -50,8 +42,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The Delete NetworkSecurityGroup operation deletes the specified network - /// security group + /// Deletes the specified network security group. /// /// /// The name of the resource group. @@ -65,17 +56,16 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, networkSecurityGroupName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The Delete NetworkSecurityGroup operation deletes the specified network - /// security group + /// Deletes the specified network security group. /// /// /// The name of the resource group. @@ -89,63 +79,69 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (networkSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkSecurityGroupName}", Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -178,30 +174,35 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 202 && (int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -211,7 +212,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -220,14 +221,13 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Get NetworkSecurityGroups operation retrieves information about the - /// specified network security group. + /// Gets the specified network security group. /// /// /// The name of the resource group. @@ -236,7 +236,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// The name of the network security group. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// Headers that will be added to request. @@ -244,68 +244,77 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (networkSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkSecurityGroupName}", Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (expand != null) { - _queryParameters.Add(string.Format("$expand={0}", Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -338,43 +347,43 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -384,7 +393,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -397,28 +406,28 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Put NetworkSecurityGroup operation creates/updates a network security - /// group in the specified resource group. + /// Creates or updates a network security group in the specified resource + /// group. /// /// /// The name of the resource group. @@ -427,7 +436,8 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// The name of the network security group. /// /// - /// Parameters supplied to the create/update Network Security Group operation + /// Parameters supplied to the create or update network security group + /// operation. /// /// /// The headers that will be added to request. @@ -435,10 +445,10 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, networkSecurityGroupName, parameters, customHeaders, cancellationToken); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, @@ -446,8 +456,8 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) } /// - /// The Put NetworkSecurityGroup operation creates/updates a network security - /// group in the specified resource group. + /// Creates or updates a network security group in the specified resource + /// group. /// /// /// The name of the resource group. @@ -456,7 +466,8 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// The name of the network security group. /// /// - /// Parameters supplied to the create/update Network Security Group operation + /// Parameters supplied to the create or update network security group + /// operation. /// /// /// Headers that will be added to request. @@ -464,68 +475,77 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (networkSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); } if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkSecurityGroupName}", Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -551,9 +571,9 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) string _requestContent = null; if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) @@ -564,43 +584,43 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 201 && (int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -610,7 +630,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -623,16 +643,16 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -641,28 +661,27 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// subscription + /// Gets all network security groups in a subscription. /// /// /// Headers that will be added to request. @@ -670,51 +689,60 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -747,43 +775,43 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -793,7 +821,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -806,28 +834,27 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// resource group + /// Gets all network security groups in a resource group. /// /// /// The name of the resource group. @@ -838,57 +865,66 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -921,43 +957,43 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -967,7 +1003,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -980,28 +1016,27 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// subscription + /// Gets all network security groups in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -1012,43 +1047,52 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1081,43 +1125,43 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1127,7 +1171,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1140,28 +1184,27 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// resource group + /// Gets all network security groups in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -1172,43 +1215,52 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1241,43 +1293,43 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1287,7 +1339,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1300,21 +1352,21 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperationsExtensions.cs index 9e23ef2620e52..0dc9b17b60672 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperationsExtensions.cs @@ -2,20 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; + using Microsoft.Rest.Azure; + using Models; /// /// Extension methods for NetworkSecurityGroupsOperations. @@ -23,8 +18,7 @@ namespace Microsoft.Azure.Management.Network public static partial class NetworkSecurityGroupsOperationsExtensions { /// - /// The Delete NetworkSecurityGroup operation deletes the specified network - /// security group + /// Deletes the specified network security group. /// /// /// The operations group for this extension method. @@ -37,12 +31,11 @@ public static partial class NetworkSecurityGroupsOperationsExtensions /// public static void Delete(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName) { - Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).DeleteAsync(resourceGroupName, networkSecurityGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).DeleteAsync(resourceGroupName, networkSecurityGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete NetworkSecurityGroup operation deletes the specified network - /// security group + /// Deletes the specified network security group. /// /// /// The operations group for this extension method. @@ -56,14 +49,13 @@ public static void Delete(this INetworkSecurityGroupsOperations operations, stri /// /// The cancellation token. /// - public static async Task DeleteAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Delete NetworkSecurityGroup operation deletes the specified network - /// security group + /// Deletes the specified network security group. /// /// /// The operations group for this extension method. @@ -76,12 +68,11 @@ public static void Delete(this INetworkSecurityGroupsOperations operations, stri /// public static void BeginDelete(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName) { - Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).BeginDeleteAsync(resourceGroupName, networkSecurityGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).BeginDeleteAsync(resourceGroupName, networkSecurityGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete NetworkSecurityGroup operation deletes the specified network - /// security group + /// Deletes the specified network security group. /// /// /// The operations group for this extension method. @@ -95,14 +86,13 @@ public static void BeginDelete(this INetworkSecurityGroupsOperations operations, /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Get NetworkSecurityGroups operation retrieves information about the - /// specified network security group. + /// Gets the specified network security group. /// /// /// The operations group for this extension method. @@ -114,16 +104,15 @@ public static void BeginDelete(this INetworkSecurityGroupsOperations operations, /// The name of the network security group. /// /// - /// expand references resources. + /// Expands referenced resources. /// public static NetworkSecurityGroup Get(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, string expand = default(string)) { - return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).GetAsync(resourceGroupName, networkSecurityGroupName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).GetAsync(resourceGroupName, networkSecurityGroupName, expand), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get NetworkSecurityGroups operation retrieves information about the - /// specified network security group. + /// Gets the specified network security group. /// /// /// The operations group for this extension method. @@ -135,12 +124,12 @@ public static void BeginDelete(this INetworkSecurityGroupsOperations operations, /// The name of the network security group. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// The cancellation token. /// - public static async Task GetAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, expand, null, cancellationToken).ConfigureAwait(false)) { @@ -149,8 +138,8 @@ public static void BeginDelete(this INetworkSecurityGroupsOperations operations, } /// - /// The Put NetworkSecurityGroup operation creates/updates a network security - /// group in the specified resource group. + /// Creates or updates a network security group in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -162,16 +151,17 @@ public static void BeginDelete(this INetworkSecurityGroupsOperations operations, /// The name of the network security group. /// /// - /// Parameters supplied to the create/update Network Security Group operation + /// Parameters supplied to the create or update network security group + /// operation. /// public static NetworkSecurityGroup CreateOrUpdate(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters) { - return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).CreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).CreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put NetworkSecurityGroup operation creates/updates a network security - /// group in the specified resource group. + /// Creates or updates a network security group in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -183,12 +173,13 @@ public static NetworkSecurityGroup CreateOrUpdate(this INetworkSecurityGroupsOpe /// The name of the network security group. /// /// - /// Parameters supplied to the create/update Network Security Group operation + /// Parameters supplied to the create or update network security group + /// operation. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -197,8 +188,8 @@ public static NetworkSecurityGroup CreateOrUpdate(this INetworkSecurityGroupsOpe } /// - /// The Put NetworkSecurityGroup operation creates/updates a network security - /// group in the specified resource group. + /// Creates or updates a network security group in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -210,16 +201,17 @@ public static NetworkSecurityGroup CreateOrUpdate(this INetworkSecurityGroupsOpe /// The name of the network security group. /// /// - /// Parameters supplied to the create/update Network Security Group operation + /// Parameters supplied to the create or update network security group + /// operation. /// public static NetworkSecurityGroup BeginCreateOrUpdate(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters) { - return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put NetworkSecurityGroup operation creates/updates a network security - /// group in the specified resource group. + /// Creates or updates a network security group in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -231,12 +223,13 @@ public static NetworkSecurityGroup BeginCreateOrUpdate(this INetworkSecurityGrou /// The name of the network security group. /// /// - /// Parameters supplied to the create/update Network Security Group operation + /// Parameters supplied to the create or update network security group + /// operation. /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -245,20 +238,18 @@ public static NetworkSecurityGroup BeginCreateOrUpdate(this INetworkSecurityGrou } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// subscription + /// Gets all network security groups in a subscription. /// /// /// The operations group for this extension method. /// - public static IPage ListAll(this INetworkSecurityGroupsOperations operations) + public static Microsoft.Rest.Azure.IPage ListAll(this INetworkSecurityGroupsOperations operations) { - return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).ListAllAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// subscription + /// Gets all network security groups in a subscription. /// /// /// The operations group for this extension method. @@ -266,7 +257,7 @@ public static IPage ListAll(this INetworkSecurityGroupsOpe /// /// The cancellation token. /// - public static async Task> ListAllAsync(this INetworkSecurityGroupsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllAsync(this INetworkSecurityGroupsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -275,8 +266,7 @@ public static IPage ListAll(this INetworkSecurityGroupsOpe } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// resource group + /// Gets all network security groups in a resource group. /// /// /// The operations group for this extension method. @@ -284,14 +274,13 @@ public static IPage ListAll(this INetworkSecurityGroupsOpe /// /// The name of the resource group. /// - public static IPage List(this INetworkSecurityGroupsOperations operations, string resourceGroupName) + public static Microsoft.Rest.Azure.IPage List(this INetworkSecurityGroupsOperations operations, string resourceGroupName) { - return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// resource group + /// Gets all network security groups in a resource group. /// /// /// The operations group for this extension method. @@ -302,7 +291,7 @@ public static IPage List(this INetworkSecurityGroupsOperat /// /// The cancellation token. /// - public static async Task> ListAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { @@ -311,8 +300,7 @@ public static IPage List(this INetworkSecurityGroupsOperat } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// subscription + /// Gets all network security groups in a subscription. /// /// /// The operations group for this extension method. @@ -320,14 +308,13 @@ public static IPage List(this INetworkSecurityGroupsOperat /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListAllNext(this INetworkSecurityGroupsOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListAllNext(this INetworkSecurityGroupsOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).ListAllNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).ListAllNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// subscription + /// Gets all network security groups in a subscription. /// /// /// The operations group for this extension method. @@ -338,7 +325,7 @@ public static IPage ListAllNext(this INetworkSecurityGroup /// /// The cancellation token. /// - public static async Task> ListAllNextAsync(this INetworkSecurityGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllNextAsync(this INetworkSecurityGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -347,8 +334,7 @@ public static IPage ListAllNext(this INetworkSecurityGroup } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// resource group + /// Gets all network security groups in a resource group. /// /// /// The operations group for this extension method. @@ -356,14 +342,13 @@ public static IPage ListAllNext(this INetworkSecurityGroup /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this INetworkSecurityGroupsOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListNext(this INetworkSecurityGroupsOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// resource group + /// Gets all network security groups in a resource group. /// /// /// The operations group for this extension method. @@ -374,7 +359,7 @@ public static IPage ListNext(this INetworkSecurityGroupsOp /// /// The cancellation token. /// - public static async Task> ListNextAsync(this INetworkSecurityGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this INetworkSecurityGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperations.cs index 0f4c99fc285e7..f76a6bac74c34 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperations.cs @@ -2,32 +2,21 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; using System.Linq; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using Microsoft.Rest.Azure; using Models; /// /// PublicIPAddressesOperations operations. /// - internal partial class PublicIPAddressesOperations : IServiceOperations, IPublicIPAddressesOperations + internal partial class PublicIPAddressesOperations : Microsoft.Rest.IServiceOperations, IPublicIPAddressesOperations { /// /// Initializes a new instance of the PublicIPAddressesOperations class. @@ -35,11 +24,14 @@ internal partial class PublicIPAddressesOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal PublicIPAddressesOperations(NetworkManagementClient client) { if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } this.Client = client; } @@ -50,7 +42,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The delete publicIpAddress operation deletes the specified publicIpAddress. + /// Deletes the specified public IP address. /// /// /// The name of the resource group. @@ -64,16 +56,16 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, publicIpAddressName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete publicIpAddress operation deletes the specified publicIpAddress. + /// Deletes the specified public IP address. /// /// /// The name of the resource group. @@ -87,63 +79,69 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (publicIpAddressName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicIpAddressName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("publicIpAddressName", publicIpAddressName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{publicIpAddressName}", Uri.EscapeDataString(publicIpAddressName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -176,30 +174,35 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -209,7 +212,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -218,14 +221,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Get publicIpAddress operation retrieves information about the - /// specified pubicIpAddress + /// Gets the specified public IP address in a specified resource group. /// /// /// The name of the resource group. @@ -234,7 +236,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// The name of the subnet. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// Headers that will be added to request. @@ -242,68 +244,77 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (publicIpAddressName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicIpAddressName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("publicIpAddressName", publicIpAddressName); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{publicIpAddressName}", Uri.EscapeDataString(publicIpAddressName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (expand != null) { - _queryParameters.Add(string.Format("$expand={0}", Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -336,43 +347,43 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -382,7 +393,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -395,37 +406,36 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Put PublicIPAddress operation creates/updates a stable/dynamic - /// PublicIP address + /// Creates or updates a static or dynamic public IP address. /// /// /// The name of the resource group. /// /// - /// The name of the publicIpAddress. + /// The name of the public IP address. /// /// - /// Parameters supplied to the create/update PublicIPAddress operation + /// Parameters supplied to the create or update public IP address operation. /// /// /// The headers that will be added to request. @@ -433,10 +443,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, publicIpAddressName, parameters, customHeaders, cancellationToken); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, @@ -444,17 +454,16 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) } /// - /// The Put PublicIPAddress operation creates/updates a stable/dynamic - /// PublicIP address + /// Creates or updates a static or dynamic public IP address. /// /// /// The name of the resource group. /// /// - /// The name of the publicIpAddress. + /// The name of the public IP address. /// /// - /// Parameters supplied to the create/update PublicIPAddress operation + /// Parameters supplied to the create or update public IP address operation. /// /// /// Headers that will be added to request. @@ -462,68 +471,77 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (publicIpAddressName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicIpAddressName"); } if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("publicIpAddressName", publicIpAddressName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{publicIpAddressName}", Uri.EscapeDataString(publicIpAddressName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -549,9 +567,9 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) string _requestContent = null; if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) @@ -562,43 +580,43 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 201 && (int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -608,7 +626,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -621,16 +639,16 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -639,28 +657,27 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a subscription. + /// Gets all the public IP addresses in a subscription. /// /// /// Headers that will be added to request. @@ -668,51 +685,60 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -745,43 +771,43 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -791,7 +817,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -804,28 +830,27 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a resource group. + /// Gets all public IP addresses in a resource group. /// /// /// The name of the resource group. @@ -836,57 +861,66 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -919,43 +953,43 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -965,7 +999,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -978,28 +1012,27 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a subscription. + /// Gets all the public IP addresses in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -1010,43 +1043,52 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1079,43 +1121,43 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1125,7 +1167,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1138,28 +1180,27 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a resource group. + /// Gets all public IP addresses in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -1170,43 +1211,52 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1239,43 +1289,43 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1285,7 +1335,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1298,21 +1348,21 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperationsExtensions.cs index 423275dd0df4f..ae604604140f1 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperationsExtensions.cs @@ -2,20 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; + using Microsoft.Rest.Azure; + using Models; /// /// Extension methods for PublicIPAddressesOperations. @@ -23,7 +18,7 @@ namespace Microsoft.Azure.Management.Network public static partial class PublicIPAddressesOperationsExtensions { /// - /// The delete publicIpAddress operation deletes the specified publicIpAddress. + /// Deletes the specified public IP address. /// /// /// The operations group for this extension method. @@ -36,11 +31,11 @@ public static partial class PublicIPAddressesOperationsExtensions /// public static void Delete(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName) { - Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).DeleteAsync(resourceGroupName, publicIpAddressName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).DeleteAsync(resourceGroupName, publicIpAddressName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete publicIpAddress operation deletes the specified publicIpAddress. + /// Deletes the specified public IP address. /// /// /// The operations group for this extension method. @@ -54,13 +49,13 @@ public static void Delete(this IPublicIPAddressesOperations operations, string r /// /// The cancellation token. /// - public static async Task DeleteAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, null, cancellationToken).ConfigureAwait(false); } /// - /// The delete publicIpAddress operation deletes the specified publicIpAddress. + /// Deletes the specified public IP address. /// /// /// The operations group for this extension method. @@ -73,11 +68,11 @@ public static void Delete(this IPublicIPAddressesOperations operations, string r /// public static void BeginDelete(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName) { - Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).BeginDeleteAsync(resourceGroupName, publicIpAddressName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).BeginDeleteAsync(resourceGroupName, publicIpAddressName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete publicIpAddress operation deletes the specified publicIpAddress. + /// Deletes the specified public IP address. /// /// /// The operations group for this extension method. @@ -91,14 +86,13 @@ public static void BeginDelete(this IPublicIPAddressesOperations operations, str /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Get publicIpAddress operation retrieves information about the - /// specified pubicIpAddress + /// Gets the specified public IP address in a specified resource group. /// /// /// The operations group for this extension method. @@ -110,16 +104,15 @@ public static void BeginDelete(this IPublicIPAddressesOperations operations, str /// The name of the subnet. /// /// - /// expand references resources. + /// Expands referenced resources. /// public static PublicIPAddress Get(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, string expand = default(string)) { - return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).GetAsync(resourceGroupName, publicIpAddressName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).GetAsync(resourceGroupName, publicIpAddressName, expand), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get publicIpAddress operation retrieves information about the - /// specified pubicIpAddress + /// Gets the specified public IP address in a specified resource group. /// /// /// The operations group for this extension method. @@ -131,12 +124,12 @@ public static void BeginDelete(this IPublicIPAddressesOperations operations, str /// The name of the subnet. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// The cancellation token. /// - public static async Task GetAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, expand, null, cancellationToken).ConfigureAwait(false)) { @@ -145,8 +138,7 @@ public static void BeginDelete(this IPublicIPAddressesOperations operations, str } /// - /// The Put PublicIPAddress operation creates/updates a stable/dynamic - /// PublicIP address + /// Creates or updates a static or dynamic public IP address. /// /// /// The operations group for this extension method. @@ -155,19 +147,18 @@ public static void BeginDelete(this IPublicIPAddressesOperations operations, str /// The name of the resource group. /// /// - /// The name of the publicIpAddress. + /// The name of the public IP address. /// /// - /// Parameters supplied to the create/update PublicIPAddress operation + /// Parameters supplied to the create or update public IP address operation. /// public static PublicIPAddress CreateOrUpdate(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters) { - return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).CreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).CreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put PublicIPAddress operation creates/updates a stable/dynamic - /// PublicIP address + /// Creates or updates a static or dynamic public IP address. /// /// /// The operations group for this extension method. @@ -176,15 +167,15 @@ public static PublicIPAddress CreateOrUpdate(this IPublicIPAddressesOperations o /// The name of the resource group. /// /// - /// The name of the publicIpAddress. + /// The name of the public IP address. /// /// - /// Parameters supplied to the create/update PublicIPAddress operation + /// Parameters supplied to the create or update public IP address operation. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -193,8 +184,7 @@ public static PublicIPAddress CreateOrUpdate(this IPublicIPAddressesOperations o } /// - /// The Put PublicIPAddress operation creates/updates a stable/dynamic - /// PublicIP address + /// Creates or updates a static or dynamic public IP address. /// /// /// The operations group for this extension method. @@ -203,19 +193,18 @@ public static PublicIPAddress CreateOrUpdate(this IPublicIPAddressesOperations o /// The name of the resource group. /// /// - /// The name of the publicIpAddress. + /// The name of the public IP address. /// /// - /// Parameters supplied to the create/update PublicIPAddress operation + /// Parameters supplied to the create or update public IP address operation. /// public static PublicIPAddress BeginCreateOrUpdate(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters) { - return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put PublicIPAddress operation creates/updates a stable/dynamic - /// PublicIP address + /// Creates or updates a static or dynamic public IP address. /// /// /// The operations group for this extension method. @@ -224,15 +213,15 @@ public static PublicIPAddress BeginCreateOrUpdate(this IPublicIPAddressesOperati /// The name of the resource group. /// /// - /// The name of the publicIpAddress. + /// The name of the public IP address. /// /// - /// Parameters supplied to the create/update PublicIPAddress operation + /// Parameters supplied to the create or update public IP address operation. /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -241,20 +230,18 @@ public static PublicIPAddress BeginCreateOrUpdate(this IPublicIPAddressesOperati } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a subscription. + /// Gets all the public IP addresses in a subscription. /// /// /// The operations group for this extension method. /// - public static IPage ListAll(this IPublicIPAddressesOperations operations) + public static Microsoft.Rest.Azure.IPage ListAll(this IPublicIPAddressesOperations operations) { - return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).ListAllAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a subscription. + /// Gets all the public IP addresses in a subscription. /// /// /// The operations group for this extension method. @@ -262,7 +249,7 @@ public static IPage ListAll(this IPublicIPAddressesOperations o /// /// The cancellation token. /// - public static async Task> ListAllAsync(this IPublicIPAddressesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllAsync(this IPublicIPAddressesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -271,8 +258,7 @@ public static IPage ListAll(this IPublicIPAddressesOperations o } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a resource group. + /// Gets all public IP addresses in a resource group. /// /// /// The operations group for this extension method. @@ -280,14 +266,13 @@ public static IPage ListAll(this IPublicIPAddressesOperations o /// /// The name of the resource group. /// - public static IPage List(this IPublicIPAddressesOperations operations, string resourceGroupName) + public static Microsoft.Rest.Azure.IPage List(this IPublicIPAddressesOperations operations, string resourceGroupName) { - return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a resource group. + /// Gets all public IP addresses in a resource group. /// /// /// The operations group for this extension method. @@ -298,7 +283,7 @@ public static IPage List(this IPublicIPAddressesOperations oper /// /// The cancellation token. /// - public static async Task> ListAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { @@ -307,8 +292,7 @@ public static IPage List(this IPublicIPAddressesOperations oper } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a subscription. + /// Gets all the public IP addresses in a subscription. /// /// /// The operations group for this extension method. @@ -316,14 +300,13 @@ public static IPage List(this IPublicIPAddressesOperations oper /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListAllNext(this IPublicIPAddressesOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListAllNext(this IPublicIPAddressesOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).ListAllNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).ListAllNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a subscription. + /// Gets all the public IP addresses in a subscription. /// /// /// The operations group for this extension method. @@ -334,7 +317,7 @@ public static IPage ListAllNext(this IPublicIPAddressesOperatio /// /// The cancellation token. /// - public static async Task> ListAllNextAsync(this IPublicIPAddressesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllNextAsync(this IPublicIPAddressesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -343,8 +326,7 @@ public static IPage ListAllNext(this IPublicIPAddressesOperatio } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a resource group. + /// Gets all public IP addresses in a resource group. /// /// /// The operations group for this extension method. @@ -352,14 +334,13 @@ public static IPage ListAllNext(this IPublicIPAddressesOperatio /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this IPublicIPAddressesOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListNext(this IPublicIPAddressesOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a resource group. + /// Gets all public IP addresses in a resource group. /// /// /// The operations group for this extension method. @@ -370,7 +351,7 @@ public static IPage ListNext(this IPublicIPAddressesOperations /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IPublicIPAddressesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this IPublicIPAddressesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperations.cs index 1ab67764026a5..a6c410530044c 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperations.cs @@ -2,32 +2,21 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; using System.Linq; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using Microsoft.Rest.Azure; using Models; /// /// RouteTablesOperations operations. /// - internal partial class RouteTablesOperations : IServiceOperations, IRouteTablesOperations + internal partial class RouteTablesOperations : Microsoft.Rest.IServiceOperations, IRouteTablesOperations { /// /// Initializes a new instance of the RouteTablesOperations class. @@ -35,11 +24,14 @@ internal partial class RouteTablesOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal RouteTablesOperations(NetworkManagementClient client) { if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } this.Client = client; } @@ -50,7 +42,7 @@ internal RouteTablesOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The Delete RouteTable operation deletes the specified Route Table + /// Deletes the specified route table. /// /// /// The name of the resource group. @@ -64,16 +56,16 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, routeTableName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The Delete RouteTable operation deletes the specified Route Table + /// Deletes the specified route table. /// /// /// The name of the resource group. @@ -87,63 +79,69 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{routeTableName}", Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -176,30 +174,35 @@ internal RouteTablesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 204 && (int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -209,7 +212,7 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -218,14 +221,13 @@ internal RouteTablesOperations(NetworkManagementClient client) } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Get RouteTables operation retrieves information about the specified - /// route table. + /// Gets the specified route table. /// /// /// The name of the resource group. @@ -234,7 +236,7 @@ internal RouteTablesOperations(NetworkManagementClient client) /// The name of the route table. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// Headers that will be added to request. @@ -242,68 +244,77 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{routeTableName}", Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (expand != null) { - _queryParameters.Add(string.Format("$expand={0}", Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -336,43 +347,43 @@ internal RouteTablesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -382,7 +393,7 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -395,28 +406,27 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Put RouteTable operation creates/updates a route table in the - /// specified resource group. + /// Create or updates a route table in a specified resource group. /// /// /// The name of the resource group. @@ -425,7 +435,7 @@ internal RouteTablesOperations(NetworkManagementClient client) /// The name of the route table. /// /// - /// Parameters supplied to the create/update Route Table operation + /// Parameters supplied to the create or update route table operation. /// /// /// The headers that will be added to request. @@ -433,10 +443,10 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, routeTableName, parameters, customHeaders, cancellationToken); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, @@ -444,8 +454,7 @@ internal RouteTablesOperations(NetworkManagementClient client) } /// - /// The Put RouteTable operation creates/updates a route table in the - /// specified resource group. + /// Create or updates a route table in a specified resource group. /// /// /// The name of the resource group. @@ -454,7 +463,7 @@ internal RouteTablesOperations(NetworkManagementClient client) /// The name of the route table. /// /// - /// Parameters supplied to the create/update Route Table operation + /// Parameters supplied to the create or update route table operation. /// /// /// Headers that will be added to request. @@ -462,68 +471,77 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{routeTableName}", Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -549,9 +567,9 @@ internal RouteTablesOperations(NetworkManagementClient client) string _requestContent = null; if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) @@ -562,43 +580,43 @@ internal RouteTablesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -608,7 +626,7 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -621,16 +639,16 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -639,27 +657,27 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The list RouteTables returns all route tables in a resource group + /// Gets all route tables in a resource group. /// /// /// The name of the resource group. @@ -670,57 +688,66 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -753,43 +780,43 @@ internal RouteTablesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -799,7 +826,7 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -812,27 +839,27 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The list RouteTables returns all route tables in a subscription + /// Gets all route tables in a subscription. /// /// /// Headers that will be added to request. @@ -840,51 +867,60 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -917,43 +953,43 @@ internal RouteTablesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -963,7 +999,7 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -976,27 +1012,27 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The list RouteTables returns all route tables in a resource group + /// Gets all route tables in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -1007,43 +1043,52 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1076,43 +1121,43 @@ internal RouteTablesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1122,7 +1167,7 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1135,27 +1180,27 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The list RouteTables returns all route tables in a subscription + /// Gets all route tables in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -1166,43 +1211,52 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1235,43 +1289,43 @@ internal RouteTablesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1281,7 +1335,7 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1294,21 +1348,21 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperationsExtensions.cs index e63dfe0c990d8..5fd9cffa20ef5 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperationsExtensions.cs @@ -2,20 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; + using Microsoft.Rest.Azure; + using Models; /// /// Extension methods for RouteTablesOperations. @@ -23,7 +18,7 @@ namespace Microsoft.Azure.Management.Network public static partial class RouteTablesOperationsExtensions { /// - /// The Delete RouteTable operation deletes the specified Route Table + /// Deletes the specified route table. /// /// /// The operations group for this extension method. @@ -36,11 +31,11 @@ public static partial class RouteTablesOperationsExtensions /// public static void Delete(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName) { - Task.Factory.StartNew(s => ((IRouteTablesOperations)s).DeleteAsync(resourceGroupName, routeTableName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IRouteTablesOperations)s).DeleteAsync(resourceGroupName, routeTableName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete RouteTable operation deletes the specified Route Table + /// Deletes the specified route table. /// /// /// The operations group for this extension method. @@ -54,13 +49,13 @@ public static void Delete(this IRouteTablesOperations operations, string resourc /// /// The cancellation token. /// - public static async Task DeleteAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Delete RouteTable operation deletes the specified Route Table + /// Deletes the specified route table. /// /// /// The operations group for this extension method. @@ -73,11 +68,11 @@ public static void Delete(this IRouteTablesOperations operations, string resourc /// public static void BeginDelete(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName) { - Task.Factory.StartNew(s => ((IRouteTablesOperations)s).BeginDeleteAsync(resourceGroupName, routeTableName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IRouteTablesOperations)s).BeginDeleteAsync(resourceGroupName, routeTableName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete RouteTable operation deletes the specified Route Table + /// Deletes the specified route table. /// /// /// The operations group for this extension method. @@ -91,14 +86,13 @@ public static void BeginDelete(this IRouteTablesOperations operations, string re /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Get RouteTables operation retrieves information about the specified - /// route table. + /// Gets the specified route table. /// /// /// The operations group for this extension method. @@ -110,16 +104,15 @@ public static void BeginDelete(this IRouteTablesOperations operations, string re /// The name of the route table. /// /// - /// expand references resources. + /// Expands referenced resources. /// public static RouteTable Get(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, string expand = default(string)) { - return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).GetAsync(resourceGroupName, routeTableName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRouteTablesOperations)s).GetAsync(resourceGroupName, routeTableName, expand), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get RouteTables operation retrieves information about the specified - /// route table. + /// Gets the specified route table. /// /// /// The operations group for this extension method. @@ -131,12 +124,12 @@ public static void BeginDelete(this IRouteTablesOperations operations, string re /// The name of the route table. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// The cancellation token. /// - public static async Task GetAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, routeTableName, expand, null, cancellationToken).ConfigureAwait(false)) { @@ -145,8 +138,7 @@ public static void BeginDelete(this IRouteTablesOperations operations, string re } /// - /// The Put RouteTable operation creates/updates a route table in the - /// specified resource group. + /// Create or updates a route table in a specified resource group. /// /// /// The operations group for this extension method. @@ -158,16 +150,15 @@ public static void BeginDelete(this IRouteTablesOperations operations, string re /// The name of the route table. /// /// - /// Parameters supplied to the create/update Route Table operation + /// Parameters supplied to the create or update route table operation. /// public static RouteTable CreateOrUpdate(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters) { - return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).CreateOrUpdateAsync(resourceGroupName, routeTableName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRouteTablesOperations)s).CreateOrUpdateAsync(resourceGroupName, routeTableName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put RouteTable operation creates/updates a route table in the - /// specified resource group. + /// Create or updates a route table in a specified resource group. /// /// /// The operations group for this extension method. @@ -179,12 +170,12 @@ public static RouteTable CreateOrUpdate(this IRouteTablesOperations operations, /// The name of the route table. /// /// - /// Parameters supplied to the create/update Route Table operation + /// Parameters supplied to the create or update route table operation. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -193,8 +184,7 @@ public static RouteTable CreateOrUpdate(this IRouteTablesOperations operations, } /// - /// The Put RouteTable operation creates/updates a route table in the - /// specified resource group. + /// Create or updates a route table in a specified resource group. /// /// /// The operations group for this extension method. @@ -206,16 +196,15 @@ public static RouteTable CreateOrUpdate(this IRouteTablesOperations operations, /// The name of the route table. /// /// - /// Parameters supplied to the create/update Route Table operation + /// Parameters supplied to the create or update route table operation. /// public static RouteTable BeginCreateOrUpdate(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters) { - return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, routeTableName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRouteTablesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, routeTableName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put RouteTable operation creates/updates a route table in the - /// specified resource group. + /// Create or updates a route table in a specified resource group. /// /// /// The operations group for this extension method. @@ -227,12 +216,12 @@ public static RouteTable BeginCreateOrUpdate(this IRouteTablesOperations operati /// The name of the route table. /// /// - /// Parameters supplied to the create/update Route Table operation + /// Parameters supplied to the create or update route table operation. /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -241,7 +230,7 @@ public static RouteTable BeginCreateOrUpdate(this IRouteTablesOperations operati } /// - /// The list RouteTables returns all route tables in a resource group + /// Gets all route tables in a resource group. /// /// /// The operations group for this extension method. @@ -249,13 +238,13 @@ public static RouteTable BeginCreateOrUpdate(this IRouteTablesOperations operati /// /// The name of the resource group. /// - public static IPage List(this IRouteTablesOperations operations, string resourceGroupName) + public static Microsoft.Rest.Azure.IPage List(this IRouteTablesOperations operations, string resourceGroupName) { - return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRouteTablesOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list RouteTables returns all route tables in a resource group + /// Gets all route tables in a resource group. /// /// /// The operations group for this extension method. @@ -266,7 +255,7 @@ public static IPage List(this IRouteTablesOperations operations, str /// /// The cancellation token. /// - public static async Task> ListAsync(this IRouteTablesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IRouteTablesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { @@ -275,18 +264,18 @@ public static IPage List(this IRouteTablesOperations operations, str } /// - /// The list RouteTables returns all route tables in a subscription + /// Gets all route tables in a subscription. /// /// /// The operations group for this extension method. /// - public static IPage ListAll(this IRouteTablesOperations operations) + public static Microsoft.Rest.Azure.IPage ListAll(this IRouteTablesOperations operations) { - return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRouteTablesOperations)s).ListAllAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list RouteTables returns all route tables in a subscription + /// Gets all route tables in a subscription. /// /// /// The operations group for this extension method. @@ -294,7 +283,7 @@ public static IPage ListAll(this IRouteTablesOperations operations) /// /// The cancellation token. /// - public static async Task> ListAllAsync(this IRouteTablesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllAsync(this IRouteTablesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -303,7 +292,7 @@ public static IPage ListAll(this IRouteTablesOperations operations) } /// - /// The list RouteTables returns all route tables in a resource group + /// Gets all route tables in a resource group. /// /// /// The operations group for this extension method. @@ -311,13 +300,13 @@ public static IPage ListAll(this IRouteTablesOperations operations) /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this IRouteTablesOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListNext(this IRouteTablesOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRouteTablesOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list RouteTables returns all route tables in a resource group + /// Gets all route tables in a resource group. /// /// /// The operations group for this extension method. @@ -328,7 +317,7 @@ public static IPage ListNext(this IRouteTablesOperations operations, /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IRouteTablesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this IRouteTablesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -337,7 +326,7 @@ public static IPage ListNext(this IRouteTablesOperations operations, } /// - /// The list RouteTables returns all route tables in a subscription + /// Gets all route tables in a subscription. /// /// /// The operations group for this extension method. @@ -345,13 +334,13 @@ public static IPage ListNext(this IRouteTablesOperations operations, /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListAllNext(this IRouteTablesOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListAllNext(this IRouteTablesOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).ListAllNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRouteTablesOperations)s).ListAllNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list RouteTables returns all route tables in a subscription + /// Gets all route tables in a subscription. /// /// /// The operations group for this extension method. @@ -362,7 +351,7 @@ public static IPage ListAllNext(this IRouteTablesOperations operatio /// /// The cancellation token. /// - public static async Task> ListAllNextAsync(this IRouteTablesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllNextAsync(this IRouteTablesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperations.cs index c86f08e1ec2df..2b0b6a170c8b7 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperations.cs @@ -2,32 +2,21 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; using System.Linq; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using Microsoft.Rest.Azure; using Models; /// /// RoutesOperations operations. /// - internal partial class RoutesOperations : IServiceOperations, IRoutesOperations + internal partial class RoutesOperations : Microsoft.Rest.IServiceOperations, IRoutesOperations { /// /// Initializes a new instance of the RoutesOperations class. @@ -35,11 +24,14 @@ internal partial class RoutesOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal RoutesOperations(NetworkManagementClient client) { if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } this.Client = client; } @@ -50,7 +42,7 @@ internal RoutesOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The delete route operation deletes the specified route from a route table. + /// Deletes the specified route from a route table. /// /// /// The name of the resource group. @@ -67,16 +59,16 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, routeTableName, routeName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete route operation deletes the specified route from a route table. + /// Deletes the specified route from a route table. /// /// /// The name of the resource group. @@ -93,69 +85,75 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } if (routeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("routeName", routeName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{routeTableName}", Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{routeName}", Uri.EscapeDataString(routeName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); + _url = _url.Replace("{routeName}", System.Uri.EscapeDataString(routeName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -188,30 +186,35 @@ internal RoutesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 202 && (int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -221,7 +224,7 @@ internal RoutesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -230,14 +233,13 @@ internal RoutesOperations(NetworkManagementClient client) } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Get route operation retrieves information about the specified route - /// from the route table. + /// Gets the specified route from a route table. /// /// /// The name of the resource group. @@ -254,69 +256,78 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } if (routeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("routeName", routeName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{routeTableName}", Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{routeName}", Uri.EscapeDataString(routeName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); + _url = _url.Replace("{routeName}", System.Uri.EscapeDataString(routeName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -349,43 +360,43 @@ internal RoutesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -395,7 +406,7 @@ internal RoutesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -408,28 +419,27 @@ internal RoutesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Put route operation creates/updates a route in the specified route - /// table + /// Creates or updates a route in the specified route table. /// /// /// The name of the resource group. @@ -441,7 +451,7 @@ internal RoutesOperations(NetworkManagementClient client) /// The name of the route. /// /// - /// Parameters supplied to the create/update route operation + /// Parameters supplied to the create or update route operation. /// /// /// The headers that will be added to request. @@ -449,10 +459,10 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, routeTableName, routeName, routeParameters, customHeaders, cancellationToken); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, @@ -460,8 +470,7 @@ internal RoutesOperations(NetworkManagementClient client) } /// - /// The Put route operation creates/updates a route in the specified route - /// table + /// Creates or updates a route in the specified route table. /// /// /// The name of the resource group. @@ -473,7 +482,7 @@ internal RoutesOperations(NetworkManagementClient client) /// The name of the route. /// /// - /// Parameters supplied to the create/update route operation + /// Parameters supplied to the create or update route operation. /// /// /// Headers that will be added to request. @@ -481,26 +490,35 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } if (routeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeName"); } if (routeParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeParameters"); } if (routeParameters != null) { @@ -508,51 +526,51 @@ internal RoutesOperations(NetworkManagementClient client) } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("routeName", routeName); tracingParameters.Add("routeParameters", routeParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{routeTableName}", Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{routeName}", Uri.EscapeDataString(routeName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); + _url = _url.Replace("{routeName}", System.Uri.EscapeDataString(routeName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -578,9 +596,9 @@ internal RoutesOperations(NetworkManagementClient client) string _requestContent = null; if(routeParameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(routeParameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(routeParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) @@ -591,43 +609,43 @@ internal RoutesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -637,7 +655,7 @@ internal RoutesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -650,16 +668,16 @@ internal RoutesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -668,28 +686,27 @@ internal RoutesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List network security rule operation retrieves all the routes in a - /// route table. + /// Gets all routes in a route table. /// /// /// The name of the resource group. @@ -703,63 +720,72 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (routeTableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{routeTableName}", Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -792,43 +818,43 @@ internal RoutesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -838,7 +864,7 @@ internal RoutesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -851,28 +877,27 @@ internal RoutesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List network security rule operation retrieves all the routes in a - /// route table. + /// Gets all routes in a route table. /// /// /// The NextLink from the previous successful call to List operation. @@ -883,43 +908,52 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -952,43 +986,43 @@ internal RoutesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -998,7 +1032,7 @@ internal RoutesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1011,21 +1045,21 @@ internal RoutesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperationsExtensions.cs index 98a96d383d6c1..5a32eeffb5b49 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperationsExtensions.cs @@ -2,20 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; + using Microsoft.Rest.Azure; + using Models; /// /// Extension methods for RoutesOperations. @@ -23,7 +18,7 @@ namespace Microsoft.Azure.Management.Network public static partial class RoutesOperationsExtensions { /// - /// The delete route operation deletes the specified route from a route table. + /// Deletes the specified route from a route table. /// /// /// The operations group for this extension method. @@ -39,11 +34,11 @@ public static partial class RoutesOperationsExtensions /// public static void Delete(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName) { - Task.Factory.StartNew(s => ((IRoutesOperations)s).DeleteAsync(resourceGroupName, routeTableName, routeName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IRoutesOperations)s).DeleteAsync(resourceGroupName, routeTableName, routeName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete route operation deletes the specified route from a route table. + /// Deletes the specified route from a route table. /// /// /// The operations group for this extension method. @@ -60,13 +55,13 @@ public static void Delete(this IRoutesOperations operations, string resourceGrou /// /// The cancellation token. /// - public static async Task DeleteAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, null, cancellationToken).ConfigureAwait(false); } /// - /// The delete route operation deletes the specified route from a route table. + /// Deletes the specified route from a route table. /// /// /// The operations group for this extension method. @@ -82,11 +77,11 @@ public static void Delete(this IRoutesOperations operations, string resourceGrou /// public static void BeginDelete(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName) { - Task.Factory.StartNew(s => ((IRoutesOperations)s).BeginDeleteAsync(resourceGroupName, routeTableName, routeName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IRoutesOperations)s).BeginDeleteAsync(resourceGroupName, routeTableName, routeName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete route operation deletes the specified route from a route table. + /// Deletes the specified route from a route table. /// /// /// The operations group for this extension method. @@ -103,14 +98,13 @@ public static void BeginDelete(this IRoutesOperations operations, string resourc /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Get route operation retrieves information about the specified route - /// from the route table. + /// Gets the specified route from a route table. /// /// /// The operations group for this extension method. @@ -126,12 +120,11 @@ public static void BeginDelete(this IRoutesOperations operations, string resourc /// public static Route Get(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName) { - return Task.Factory.StartNew(s => ((IRoutesOperations)s).GetAsync(resourceGroupName, routeTableName, routeName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRoutesOperations)s).GetAsync(resourceGroupName, routeTableName, routeName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get route operation retrieves information about the specified route - /// from the route table. + /// Gets the specified route from a route table. /// /// /// The operations group for this extension method. @@ -148,7 +141,7 @@ public static Route Get(this IRoutesOperations operations, string resourceGroupN /// /// The cancellation token. /// - public static async Task GetAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, null, cancellationToken).ConfigureAwait(false)) { @@ -157,8 +150,7 @@ public static Route Get(this IRoutesOperations operations, string resourceGroupN } /// - /// The Put route operation creates/updates a route in the specified route - /// table + /// Creates or updates a route in the specified route table. /// /// /// The operations group for this extension method. @@ -173,16 +165,15 @@ public static Route Get(this IRoutesOperations operations, string resourceGroupN /// The name of the route. /// /// - /// Parameters supplied to the create/update route operation + /// Parameters supplied to the create or update route operation. /// public static Route CreateOrUpdate(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters) { - return Task.Factory.StartNew(s => ((IRoutesOperations)s).CreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRoutesOperations)s).CreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put route operation creates/updates a route in the specified route - /// table + /// Creates or updates a route in the specified route table. /// /// /// The operations group for this extension method. @@ -197,12 +188,12 @@ public static Route CreateOrUpdate(this IRoutesOperations operations, string res /// The name of the route. /// /// - /// Parameters supplied to the create/update route operation + /// Parameters supplied to the create or update route operation. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, routeParameters, null, cancellationToken).ConfigureAwait(false)) { @@ -211,8 +202,7 @@ public static Route CreateOrUpdate(this IRoutesOperations operations, string res } /// - /// The Put route operation creates/updates a route in the specified route - /// table + /// Creates or updates a route in the specified route table. /// /// /// The operations group for this extension method. @@ -227,16 +217,15 @@ public static Route CreateOrUpdate(this IRoutesOperations operations, string res /// The name of the route. /// /// - /// Parameters supplied to the create/update route operation + /// Parameters supplied to the create or update route operation. /// public static Route BeginCreateOrUpdate(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters) { - return Task.Factory.StartNew(s => ((IRoutesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRoutesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put route operation creates/updates a route in the specified route - /// table + /// Creates or updates a route in the specified route table. /// /// /// The operations group for this extension method. @@ -251,12 +240,12 @@ public static Route BeginCreateOrUpdate(this IRoutesOperations operations, strin /// The name of the route. /// /// - /// Parameters supplied to the create/update route operation + /// Parameters supplied to the create or update route operation. /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, routeParameters, null, cancellationToken).ConfigureAwait(false)) { @@ -265,8 +254,7 @@ public static Route BeginCreateOrUpdate(this IRoutesOperations operations, strin } /// - /// The List network security rule operation retrieves all the routes in a - /// route table. + /// Gets all routes in a route table. /// /// /// The operations group for this extension method. @@ -277,14 +265,13 @@ public static Route BeginCreateOrUpdate(this IRoutesOperations operations, strin /// /// The name of the route table. /// - public static IPage List(this IRoutesOperations operations, string resourceGroupName, string routeTableName) + public static Microsoft.Rest.Azure.IPage List(this IRoutesOperations operations, string resourceGroupName, string routeTableName) { - return Task.Factory.StartNew(s => ((IRoutesOperations)s).ListAsync(resourceGroupName, routeTableName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRoutesOperations)s).ListAsync(resourceGroupName, routeTableName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List network security rule operation retrieves all the routes in a - /// route table. + /// Gets all routes in a route table. /// /// /// The operations group for this extension method. @@ -298,7 +285,7 @@ public static IPage List(this IRoutesOperations operations, string resour /// /// The cancellation token. /// - public static async Task> ListAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, routeTableName, null, cancellationToken).ConfigureAwait(false)) { @@ -307,8 +294,7 @@ public static IPage List(this IRoutesOperations operations, string resour } /// - /// The List network security rule operation retrieves all the routes in a - /// route table. + /// Gets all routes in a route table. /// /// /// The operations group for this extension method. @@ -316,14 +302,13 @@ public static IPage List(this IRoutesOperations operations, string resour /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this IRoutesOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListNext(this IRoutesOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IRoutesOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRoutesOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List network security rule operation retrieves all the routes in a - /// route table. + /// Gets all routes in a route table. /// /// /// The operations group for this extension method. @@ -334,7 +319,7 @@ public static IPage ListNext(this IRoutesOperations operations, string ne /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IRoutesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this IRoutesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperations.cs index b493f61fc4873..838c35f7f8df0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperations.cs @@ -2,32 +2,21 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; using System.Linq; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using Microsoft.Rest.Azure; using Models; /// /// SecurityRulesOperations operations. /// - internal partial class SecurityRulesOperations : IServiceOperations, ISecurityRulesOperations + internal partial class SecurityRulesOperations : Microsoft.Rest.IServiceOperations, ISecurityRulesOperations { /// /// Initializes a new instance of the SecurityRulesOperations class. @@ -35,11 +24,14 @@ internal partial class SecurityRulesOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal SecurityRulesOperations(NetworkManagementClient client) { if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } this.Client = client; } @@ -50,8 +42,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The delete network security rule operation deletes the specified network - /// security rule. + /// Deletes the specified network security rule. /// /// /// The name of the resource group. @@ -68,17 +59,16 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, networkSecurityGroupName, securityRuleName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete network security rule operation deletes the specified network - /// security rule. + /// Deletes the specified network security rule. /// /// /// The name of the resource group. @@ -95,69 +85,75 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (networkSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); } if (securityRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "securityRuleName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("securityRuleName", securityRuleName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkSecurityGroupName}", Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{securityRuleName}", Uri.EscapeDataString(securityRuleName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); + _url = _url.Replace("{securityRuleName}", System.Uri.EscapeDataString(securityRuleName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -190,30 +186,35 @@ internal SecurityRulesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -223,7 +224,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -232,14 +233,13 @@ internal SecurityRulesOperations(NetworkManagementClient client) } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Get NetworkSecurityRule operation retrieves information about the - /// specified network security rule. + /// Get the specified network security rule. /// /// /// The name of the resource group. @@ -256,69 +256,78 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (networkSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); } if (securityRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "securityRuleName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("securityRuleName", securityRuleName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkSecurityGroupName}", Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{securityRuleName}", Uri.EscapeDataString(securityRuleName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); + _url = _url.Replace("{securityRuleName}", System.Uri.EscapeDataString(securityRuleName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -351,43 +360,43 @@ internal SecurityRulesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -397,7 +406,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -410,28 +419,27 @@ internal SecurityRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Put network security rule operation creates/updates a security rule in - /// the specified network security group + /// Creates or updates a security rule in the specified network security group. /// /// /// The name of the resource group. @@ -443,7 +451,8 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// The name of the security rule. /// /// - /// Parameters supplied to the create/update network security rule operation + /// Parameters supplied to the create or update network security rule + /// operation. /// /// /// The headers that will be added to request. @@ -451,10 +460,10 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, customHeaders, cancellationToken); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, @@ -462,8 +471,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) } /// - /// The Put network security rule operation creates/updates a security rule in - /// the specified network security group + /// Creates or updates a security rule in the specified network security group. /// /// /// The name of the resource group. @@ -475,7 +483,8 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// The name of the security rule. /// /// - /// Parameters supplied to the create/update network security rule operation + /// Parameters supplied to the create or update network security rule + /// operation. /// /// /// Headers that will be added to request. @@ -483,26 +492,35 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (networkSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); } if (securityRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "securityRuleName"); } if (securityRuleParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "securityRuleParameters"); } if (securityRuleParameters != null) { @@ -510,51 +528,51 @@ internal SecurityRulesOperations(NetworkManagementClient client) } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("securityRuleName", securityRuleName); tracingParameters.Add("securityRuleParameters", securityRuleParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkSecurityGroupName}", Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{securityRuleName}", Uri.EscapeDataString(securityRuleName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); + _url = _url.Replace("{securityRuleName}", System.Uri.EscapeDataString(securityRuleName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -580,9 +598,9 @@ internal SecurityRulesOperations(NetworkManagementClient client) string _requestContent = null; if(securityRuleParameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(securityRuleParameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(securityRuleParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) @@ -593,43 +611,43 @@ internal SecurityRulesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -639,7 +657,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -652,16 +670,16 @@ internal SecurityRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -670,28 +688,27 @@ internal SecurityRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List network security rule operation retrieves all the security rules - /// in a network security group. + /// Gets all security rules in a network security group. /// /// /// The name of the resource group. @@ -705,63 +722,72 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (networkSecurityGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkSecurityGroupName}", Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -794,43 +820,43 @@ internal SecurityRulesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -840,7 +866,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -853,28 +879,27 @@ internal SecurityRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List network security rule operation retrieves all the security rules - /// in a network security group. + /// Gets all security rules in a network security group. /// /// /// The NextLink from the previous successful call to List operation. @@ -885,43 +910,52 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -954,43 +988,43 @@ internal SecurityRulesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1000,7 +1034,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1013,21 +1047,21 @@ internal SecurityRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperationsExtensions.cs index 7f0b4d6526f1d..8684216a15af3 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperationsExtensions.cs @@ -2,20 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; + using Microsoft.Rest.Azure; + using Models; /// /// Extension methods for SecurityRulesOperations. @@ -23,8 +18,7 @@ namespace Microsoft.Azure.Management.Network public static partial class SecurityRulesOperationsExtensions { /// - /// The delete network security rule operation deletes the specified network - /// security rule. + /// Deletes the specified network security rule. /// /// /// The operations group for this extension method. @@ -40,12 +34,11 @@ public static partial class SecurityRulesOperationsExtensions /// public static void Delete(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName) { - Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).DeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).DeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete network security rule operation deletes the specified network - /// security rule. + /// Deletes the specified network security rule. /// /// /// The operations group for this extension method. @@ -62,14 +55,13 @@ public static void Delete(this ISecurityRulesOperations operations, string resou /// /// The cancellation token. /// - public static async Task DeleteAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, null, cancellationToken).ConfigureAwait(false); } /// - /// The delete network security rule operation deletes the specified network - /// security rule. + /// Deletes the specified network security rule. /// /// /// The operations group for this extension method. @@ -85,12 +77,11 @@ public static void Delete(this ISecurityRulesOperations operations, string resou /// public static void BeginDelete(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName) { - Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).BeginDeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).BeginDeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete network security rule operation deletes the specified network - /// security rule. + /// Deletes the specified network security rule. /// /// /// The operations group for this extension method. @@ -107,14 +98,13 @@ public static void BeginDelete(this ISecurityRulesOperations operations, string /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Get NetworkSecurityRule operation retrieves information about the - /// specified network security rule. + /// Get the specified network security rule. /// /// /// The operations group for this extension method. @@ -130,12 +120,11 @@ public static void BeginDelete(this ISecurityRulesOperations operations, string /// public static SecurityRule Get(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName) { - return Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).GetAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).GetAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get NetworkSecurityRule operation retrieves information about the - /// specified network security rule. + /// Get the specified network security rule. /// /// /// The operations group for this extension method. @@ -152,7 +141,7 @@ public static SecurityRule Get(this ISecurityRulesOperations operations, string /// /// The cancellation token. /// - public static async Task GetAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, null, cancellationToken).ConfigureAwait(false)) { @@ -161,8 +150,7 @@ public static SecurityRule Get(this ISecurityRulesOperations operations, string } /// - /// The Put network security rule operation creates/updates a security rule in - /// the specified network security group + /// Creates or updates a security rule in the specified network security group. /// /// /// The operations group for this extension method. @@ -177,16 +165,16 @@ public static SecurityRule Get(this ISecurityRulesOperations operations, string /// The name of the security rule. /// /// - /// Parameters supplied to the create/update network security rule operation + /// Parameters supplied to the create or update network security rule + /// operation. /// public static SecurityRule CreateOrUpdate(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters) { - return Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).CreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).CreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put network security rule operation creates/updates a security rule in - /// the specified network security group + /// Creates or updates a security rule in the specified network security group. /// /// /// The operations group for this extension method. @@ -201,12 +189,13 @@ public static SecurityRule CreateOrUpdate(this ISecurityRulesOperations operatio /// The name of the security rule. /// /// - /// Parameters supplied to the create/update network security rule operation + /// Parameters supplied to the create or update network security rule + /// operation. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, null, cancellationToken).ConfigureAwait(false)) { @@ -215,8 +204,7 @@ public static SecurityRule CreateOrUpdate(this ISecurityRulesOperations operatio } /// - /// The Put network security rule operation creates/updates a security rule in - /// the specified network security group + /// Creates or updates a security rule in the specified network security group. /// /// /// The operations group for this extension method. @@ -231,16 +219,16 @@ public static SecurityRule CreateOrUpdate(this ISecurityRulesOperations operatio /// The name of the security rule. /// /// - /// Parameters supplied to the create/update network security rule operation + /// Parameters supplied to the create or update network security rule + /// operation. /// public static SecurityRule BeginCreateOrUpdate(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters) { - return Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put network security rule operation creates/updates a security rule in - /// the specified network security group + /// Creates or updates a security rule in the specified network security group. /// /// /// The operations group for this extension method. @@ -255,12 +243,13 @@ public static SecurityRule BeginCreateOrUpdate(this ISecurityRulesOperations ope /// The name of the security rule. /// /// - /// Parameters supplied to the create/update network security rule operation + /// Parameters supplied to the create or update network security rule + /// operation. /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, null, cancellationToken).ConfigureAwait(false)) { @@ -269,8 +258,7 @@ public static SecurityRule BeginCreateOrUpdate(this ISecurityRulesOperations ope } /// - /// The List network security rule operation retrieves all the security rules - /// in a network security group. + /// Gets all security rules in a network security group. /// /// /// The operations group for this extension method. @@ -281,14 +269,13 @@ public static SecurityRule BeginCreateOrUpdate(this ISecurityRulesOperations ope /// /// The name of the network security group. /// - public static IPage List(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName) + public static Microsoft.Rest.Azure.IPage List(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName) { - return Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).ListAsync(resourceGroupName, networkSecurityGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).ListAsync(resourceGroupName, networkSecurityGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List network security rule operation retrieves all the security rules - /// in a network security group. + /// Gets all security rules in a network security group. /// /// /// The operations group for this extension method. @@ -302,7 +289,7 @@ public static IPage List(this ISecurityRulesOperations operations, /// /// The cancellation token. /// - public static async Task> ListAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false)) { @@ -311,8 +298,7 @@ public static IPage List(this ISecurityRulesOperations operations, } /// - /// The List network security rule operation retrieves all the security rules - /// in a network security group. + /// Gets all security rules in a network security group. /// /// /// The operations group for this extension method. @@ -320,14 +306,13 @@ public static IPage List(this ISecurityRulesOperations operations, /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this ISecurityRulesOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListNext(this ISecurityRulesOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List network security rule operation retrieves all the security rules - /// in a network security group. + /// Gets all security rules in a network security group. /// /// /// The operations group for this extension method. @@ -338,7 +323,7 @@ public static IPage ListNext(this ISecurityRulesOperations operati /// /// The cancellation token. /// - public static async Task> ListNextAsync(this ISecurityRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this ISecurityRulesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperations.cs index d73f50e71b303..28ff9a0db1aa7 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperations.cs @@ -2,32 +2,21 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; using System.Linq; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using Microsoft.Rest.Azure; using Models; /// /// SubnetsOperations operations. /// - internal partial class SubnetsOperations : IServiceOperations, ISubnetsOperations + internal partial class SubnetsOperations : Microsoft.Rest.IServiceOperations, ISubnetsOperations { /// /// Initializes a new instance of the SubnetsOperations class. @@ -35,11 +24,14 @@ internal partial class SubnetsOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal SubnetsOperations(NetworkManagementClient client) { if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } this.Client = client; } @@ -50,7 +42,7 @@ internal SubnetsOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The delete subnet operation deletes the specified subnet. + /// Deletes the specified subnet. /// /// /// The name of the resource group. @@ -67,16 +59,16 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, virtualNetworkName, subnetName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete subnet operation deletes the specified subnet. + /// Deletes the specified subnet. /// /// /// The name of the resource group. @@ -93,69 +85,75 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } if (subnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "subnetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subnetName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("subnetName", subnetName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subnetName}", Uri.EscapeDataString(subnetName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -188,30 +186,35 @@ internal SubnetsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -221,7 +224,7 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -230,13 +233,13 @@ internal SubnetsOperations(NetworkManagementClient client) } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Get subnet operation retrieves information about the specified subnet. + /// Gets the specified subnet by virtual network and resource group. /// /// /// The name of the resource group. @@ -248,7 +251,7 @@ internal SubnetsOperations(NetworkManagementClient client) /// The name of the subnet. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// Headers that will be added to request. @@ -256,74 +259,83 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } if (subnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "subnetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subnetName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("subnetName", subnetName); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subnetName}", Uri.EscapeDataString(subnetName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (expand != null) { - _queryParameters.Add(string.Format("$expand={0}", Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -356,43 +368,43 @@ internal SubnetsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -402,7 +414,7 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -415,28 +427,27 @@ internal SubnetsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Put Subnet operation creates/updates a subnet in the specified virtual - /// network + /// Creates or updates a subnet in the specified virtual network. /// /// /// The name of the resource group. @@ -448,7 +459,7 @@ internal SubnetsOperations(NetworkManagementClient client) /// The name of the subnet. /// /// - /// Parameters supplied to the create/update Subnet operation + /// Parameters supplied to the create or update subnet operation. /// /// /// The headers that will be added to request. @@ -456,10 +467,10 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, virtualNetworkName, subnetName, subnetParameters, customHeaders, cancellationToken); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, @@ -467,8 +478,7 @@ internal SubnetsOperations(NetworkManagementClient client) } /// - /// The Put Subnet operation creates/updates a subnet in the specified virtual - /// network + /// Creates or updates a subnet in the specified virtual network. /// /// /// The name of the resource group. @@ -480,7 +490,7 @@ internal SubnetsOperations(NetworkManagementClient client) /// The name of the subnet. /// /// - /// Parameters supplied to the create/update Subnet operation + /// Parameters supplied to the create or update subnet operation. /// /// /// Headers that will be added to request. @@ -488,74 +498,83 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } if (subnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "subnetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subnetName"); } if (subnetParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "subnetParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subnetParameters"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("subnetName", subnetName); tracingParameters.Add("subnetParameters", subnetParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subnetName}", Uri.EscapeDataString(subnetName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -581,9 +600,9 @@ internal SubnetsOperations(NetworkManagementClient client) string _requestContent = null; if(subnetParameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(subnetParameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(subnetParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) @@ -594,43 +613,43 @@ internal SubnetsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -640,7 +659,7 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -653,16 +672,16 @@ internal SubnetsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -671,27 +690,27 @@ internal SubnetsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List subnets operation retrieves all the subnets in a virtual network. + /// Gets all subnets in a virtual network. /// /// /// The name of the resource group. @@ -705,63 +724,72 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -794,43 +822,43 @@ internal SubnetsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -840,7 +868,7 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -853,27 +881,27 @@ internal SubnetsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List subnets operation retrieves all the subnets in a virtual network. + /// Gets all subnets in a virtual network. /// /// /// The NextLink from the previous successful call to List operation. @@ -884,43 +912,52 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -953,43 +990,43 @@ internal SubnetsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -999,7 +1036,7 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1012,21 +1049,21 @@ internal SubnetsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperationsExtensions.cs index 96a5ce76ab441..c9f2d6ab8580d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperationsExtensions.cs @@ -2,20 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; + using Microsoft.Rest.Azure; + using Models; /// /// Extension methods for SubnetsOperations. @@ -23,7 +18,7 @@ namespace Microsoft.Azure.Management.Network public static partial class SubnetsOperationsExtensions { /// - /// The delete subnet operation deletes the specified subnet. + /// Deletes the specified subnet. /// /// /// The operations group for this extension method. @@ -39,11 +34,11 @@ public static partial class SubnetsOperationsExtensions /// public static void Delete(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName) { - Task.Factory.StartNew(s => ((ISubnetsOperations)s).DeleteAsync(resourceGroupName, virtualNetworkName, subnetName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((ISubnetsOperations)s).DeleteAsync(resourceGroupName, virtualNetworkName, subnetName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete subnet operation deletes the specified subnet. + /// Deletes the specified subnet. /// /// /// The operations group for this extension method. @@ -60,13 +55,13 @@ public static void Delete(this ISubnetsOperations operations, string resourceGro /// /// The cancellation token. /// - public static async Task DeleteAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, null, cancellationToken).ConfigureAwait(false); } /// - /// The delete subnet operation deletes the specified subnet. + /// Deletes the specified subnet. /// /// /// The operations group for this extension method. @@ -82,11 +77,11 @@ public static void Delete(this ISubnetsOperations operations, string resourceGro /// public static void BeginDelete(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName) { - Task.Factory.StartNew(s => ((ISubnetsOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((ISubnetsOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete subnet operation deletes the specified subnet. + /// Deletes the specified subnet. /// /// /// The operations group for this extension method. @@ -103,13 +98,13 @@ public static void BeginDelete(this ISubnetsOperations operations, string resour /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Get subnet operation retrieves information about the specified subnet. + /// Gets the specified subnet by virtual network and resource group. /// /// /// The operations group for this extension method. @@ -124,15 +119,15 @@ public static void BeginDelete(this ISubnetsOperations operations, string resour /// The name of the subnet. /// /// - /// expand references resources. + /// Expands referenced resources. /// public static Subnet Get(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string)) { - return Task.Factory.StartNew(s => ((ISubnetsOperations)s).GetAsync(resourceGroupName, virtualNetworkName, subnetName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ISubnetsOperations)s).GetAsync(resourceGroupName, virtualNetworkName, subnetName, expand), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get subnet operation retrieves information about the specified subnet. + /// Gets the specified subnet by virtual network and resource group. /// /// /// The operations group for this extension method. @@ -147,12 +142,12 @@ public static void BeginDelete(this ISubnetsOperations operations, string resour /// The name of the subnet. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// The cancellation token. /// - public static async Task GetAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, expand, null, cancellationToken).ConfigureAwait(false)) { @@ -161,8 +156,7 @@ public static void BeginDelete(this ISubnetsOperations operations, string resour } /// - /// The Put Subnet operation creates/updates a subnet in the specified virtual - /// network + /// Creates or updates a subnet in the specified virtual network. /// /// /// The operations group for this extension method. @@ -177,16 +171,15 @@ public static void BeginDelete(this ISubnetsOperations operations, string resour /// The name of the subnet. /// /// - /// Parameters supplied to the create/update Subnet operation + /// Parameters supplied to the create or update subnet operation. /// public static Subnet CreateOrUpdate(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters) { - return Task.Factory.StartNew(s => ((ISubnetsOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ISubnetsOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put Subnet operation creates/updates a subnet in the specified virtual - /// network + /// Creates or updates a subnet in the specified virtual network. /// /// /// The operations group for this extension method. @@ -201,12 +194,12 @@ public static Subnet CreateOrUpdate(this ISubnetsOperations operations, string r /// The name of the subnet. /// /// - /// Parameters supplied to the create/update Subnet operation + /// Parameters supplied to the create or update subnet operation. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, null, cancellationToken).ConfigureAwait(false)) { @@ -215,8 +208,7 @@ public static Subnet CreateOrUpdate(this ISubnetsOperations operations, string r } /// - /// The Put Subnet operation creates/updates a subnet in the specified virtual - /// network + /// Creates or updates a subnet in the specified virtual network. /// /// /// The operations group for this extension method. @@ -231,16 +223,15 @@ public static Subnet CreateOrUpdate(this ISubnetsOperations operations, string r /// The name of the subnet. /// /// - /// Parameters supplied to the create/update Subnet operation + /// Parameters supplied to the create or update subnet operation. /// public static Subnet BeginCreateOrUpdate(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters) { - return Task.Factory.StartNew(s => ((ISubnetsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ISubnetsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put Subnet operation creates/updates a subnet in the specified virtual - /// network + /// Creates or updates a subnet in the specified virtual network. /// /// /// The operations group for this extension method. @@ -255,12 +246,12 @@ public static Subnet BeginCreateOrUpdate(this ISubnetsOperations operations, str /// The name of the subnet. /// /// - /// Parameters supplied to the create/update Subnet operation + /// Parameters supplied to the create or update subnet operation. /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, null, cancellationToken).ConfigureAwait(false)) { @@ -269,7 +260,7 @@ public static Subnet BeginCreateOrUpdate(this ISubnetsOperations operations, str } /// - /// The List subnets operation retrieves all the subnets in a virtual network. + /// Gets all subnets in a virtual network. /// /// /// The operations group for this extension method. @@ -280,13 +271,13 @@ public static Subnet BeginCreateOrUpdate(this ISubnetsOperations operations, str /// /// The name of the virtual network. /// - public static IPage List(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName) + public static Microsoft.Rest.Azure.IPage List(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName) { - return Task.Factory.StartNew(s => ((ISubnetsOperations)s).ListAsync(resourceGroupName, virtualNetworkName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ISubnetsOperations)s).ListAsync(resourceGroupName, virtualNetworkName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List subnets operation retrieves all the subnets in a virtual network. + /// Gets all subnets in a virtual network. /// /// /// The operations group for this extension method. @@ -300,7 +291,7 @@ public static IPage List(this ISubnetsOperations operations, string reso /// /// The cancellation token. /// - public static async Task> ListAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)) { @@ -309,7 +300,7 @@ public static IPage List(this ISubnetsOperations operations, string reso } /// - /// The List subnets operation retrieves all the subnets in a virtual network. + /// Gets all subnets in a virtual network. /// /// /// The operations group for this extension method. @@ -317,13 +308,13 @@ public static IPage List(this ISubnetsOperations operations, string reso /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this ISubnetsOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListNext(this ISubnetsOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((ISubnetsOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ISubnetsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List subnets operation retrieves all the subnets in a virtual network. + /// Gets all subnets in a virtual network. /// /// /// The operations group for this extension method. @@ -334,7 +325,7 @@ public static IPage ListNext(this ISubnetsOperations operations, string /// /// The cancellation token. /// - public static async Task> ListNextAsync(this ISubnetsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this ISubnetsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperations.cs index b3f6376ef113c..21c97d81ac3d7 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperations.cs @@ -2,32 +2,21 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; using System.Linq; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using Microsoft.Rest.Azure; using Models; /// /// UsagesOperations operations. /// - internal partial class UsagesOperations : IServiceOperations, IUsagesOperations + internal partial class UsagesOperations : Microsoft.Rest.IServiceOperations, IUsagesOperations { /// /// Initializes a new instance of the UsagesOperations class. @@ -35,11 +24,14 @@ internal partial class UsagesOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal UsagesOperations(NetworkManagementClient client) { if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } this.Client = client; } @@ -53,7 +45,7 @@ internal UsagesOperations(NetworkManagementClient client) /// Lists compute usages for a subscription. /// /// - /// The location upon which resource usage is queried. + /// The location where resource usage is queried. /// /// /// Headers that will be added to request. @@ -61,64 +53,73 @@ internal UsagesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(location, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "location", "^[-\\w\\._]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "location", "^[-\\w\\._]+$"); } } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages").ToString(); - _url = _url.Replace("{location}", Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -151,43 +152,43 @@ internal UsagesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -197,7 +198,7 @@ internal UsagesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -210,21 +211,21 @@ internal UsagesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -241,43 +242,52 @@ internal UsagesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -310,43 +320,43 @@ internal UsagesOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -356,7 +366,7 @@ internal UsagesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -369,21 +379,21 @@ internal UsagesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperationsExtensions.cs index bae23908bd35f..5522892f2854c 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperationsExtensions.cs @@ -2,20 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; + using Microsoft.Rest.Azure; + using Models; /// /// Extension methods for UsagesOperations. @@ -29,11 +24,11 @@ public static partial class UsagesOperationsExtensions /// The operations group for this extension method. /// /// - /// The location upon which resource usage is queried. + /// The location where resource usage is queried. /// - public static IPage List(this IUsagesOperations operations, string location) + public static Microsoft.Rest.Azure.IPage List(this IUsagesOperations operations, string location) { - return Task.Factory.StartNew(s => ((IUsagesOperations)s).ListAsync(location), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IUsagesOperations)s).ListAsync(location), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -43,12 +38,12 @@ public static IPage List(this IUsagesOperations operations, string locati /// The operations group for this extension method. /// /// - /// The location upon which resource usage is queried. + /// The location where resource usage is queried. /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IUsagesOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IUsagesOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) { @@ -65,9 +60,9 @@ public static IPage List(this IUsagesOperations operations, string locati /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this IUsagesOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListNext(this IUsagesOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IUsagesOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IUsagesOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -82,7 +77,7 @@ public static IPage ListNext(this IUsagesOperations operations, string ne /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IUsagesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this IUsagesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs index ca12649ce5745..271d2afc5fad0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs @@ -2,32 +2,21 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; using System.Linq; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using Microsoft.Rest.Azure; using Models; /// /// VirtualNetworkGatewayConnectionsOperations operations. /// - internal partial class VirtualNetworkGatewayConnectionsOperations : IServiceOperations, IVirtualNetworkGatewayConnectionsOperations + internal partial class VirtualNetworkGatewayConnectionsOperations : Microsoft.Rest.IServiceOperations, IVirtualNetworkGatewayConnectionsOperations { /// /// Initializes a new instance of the VirtualNetworkGatewayConnectionsOperations class. @@ -35,11 +24,14 @@ internal partial class VirtualNetworkGatewayConnectionsOperations : IServiceOper /// /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient client) { if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } this.Client = client; } @@ -50,9 +42,8 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie public NetworkManagementClient Client { get; private set; } /// - /// The Put VirtualNetworkGatewayConnection operation creates/updates a - /// virtual network gateway connection in the specified resource group - /// through Network resource provider. + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. /// /// /// The name of the resource group. @@ -61,8 +52,8 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// The name of the virtual network gateway connection. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// connection operation through Network resource provider. + /// Parameters supplied to the create or update virtual network gateway + /// connection operation. /// /// /// The headers that will be added to request. @@ -70,10 +61,10 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, @@ -81,9 +72,8 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie } /// - /// The Put VirtualNetworkGatewayConnection operation creates/updates a - /// virtual network gateway connection in the specified resource group - /// through Network resource provider. + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. /// /// /// The name of the resource group. @@ -92,8 +82,8 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// The name of the virtual network gateway connection. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// connection operation through Network resource provider. + /// Parameters supplied to the create or update virtual network gateway + /// connection operation. /// /// /// Headers that will be added to request. @@ -101,22 +91,31 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkGatewayConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } if (parameters != null) { @@ -124,49 +123,49 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayConnectionName}", Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -192,9 +191,9 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie string _requestContent = null; if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) @@ -205,43 +204,43 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -251,7 +250,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -264,16 +263,16 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -282,29 +281,27 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Get VirtualNetworkGatewayConnection operation retrieves information - /// about the specified virtual network gateway connection through Network - /// resource provider. + /// Gets the specified virtual network gateway connection by resource group. /// /// /// The name of the resource group. @@ -318,63 +315,72 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkGatewayConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayConnectionName}", Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -407,43 +413,43 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -453,7 +459,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -466,28 +472,27 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Delete VirtualNetworkGatewayConnection operation deletes the specified - /// virtual network Gateway connection through Network resource provider. + /// Deletes the specified virtual network Gateway connection. /// /// /// The name of the resource group. @@ -501,17 +506,16 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, virtualNetworkGatewayConnectionName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The Delete VirtualNetworkGatewayConnection operation deletes the specified - /// virtual network Gateway connection through Network resource provider. + /// Deletes the specified virtual network Gateway connection. /// /// /// The name of the resource group. @@ -525,63 +529,69 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkGatewayConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayConnectionName}", Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -614,30 +624,35 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -647,7 +662,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -656,7 +671,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -683,10 +698,10 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - public async Task> SetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> SetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginSetSharedKeyWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginSetSharedKeyWithHttpMessagesAsync( resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, @@ -715,22 +730,31 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginSetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginSetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkGatewayConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } if (parameters != null) { @@ -738,49 +762,49 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginSetSharedKey", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginSetSharedKey", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayConnectionName}", Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -806,9 +830,9 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie string _requestContent = null; if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) @@ -819,43 +843,43 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 201 && (int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -865,7 +889,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -878,16 +902,16 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -896,21 +920,21 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -932,63 +956,72 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkGatewayConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSharedKey", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSharedKey", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayConnectionName}", Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1021,43 +1054,43 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1067,7 +1100,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1080,21 +1113,21 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1112,57 +1145,66 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1195,43 +1237,43 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1241,7 +1283,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1254,21 +1296,21 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1286,8 +1328,8 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the Begin Reset Virtual Network Gateway connection - /// shared key operation through Network resource provider. + /// Parameters supplied to the begin reset virtual network gateway connection + /// shared key operation through network resource provider. /// /// /// The headers that will be added to request. @@ -1295,10 +1337,10 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - public async Task> ResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginResetSharedKeyWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginResetSharedKeyWithHttpMessagesAsync( resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } @@ -1316,8 +1358,8 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the Begin Reset Virtual Network Gateway connection - /// shared key operation through Network resource provider. + /// Parameters supplied to the begin reset virtual network gateway connection + /// shared key operation through network resource provider. /// /// /// Headers that will be added to request. @@ -1325,22 +1367,31 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkGatewayConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } if (parameters != null) { @@ -1348,49 +1399,49 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginResetSharedKey", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginResetSharedKey", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayConnectionName}", Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1416,9 +1467,9 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie string _requestContent = null; if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) @@ -1429,43 +1480,43 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1475,7 +1526,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1488,21 +1539,21 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1520,43 +1571,52 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1589,43 +1649,43 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1635,7 +1695,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1648,21 +1708,21 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperationsExtensions.cs index 132337bf01905..48d410d0319e7 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperationsExtensions.cs @@ -2,20 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; + using Microsoft.Rest.Azure; + using Models; /// /// Extension methods for VirtualNetworkGatewayConnectionsOperations. @@ -23,9 +18,8 @@ namespace Microsoft.Azure.Management.Network public static partial class VirtualNetworkGatewayConnectionsOperationsExtensions { /// - /// The Put VirtualNetworkGatewayConnection operation creates/updates a - /// virtual network gateway connection in the specified resource group - /// through Network resource provider. + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. /// /// /// The operations group for this extension method. @@ -37,18 +31,17 @@ public static partial class VirtualNetworkGatewayConnectionsOperationsExtensions /// The name of the virtual network gateway connection. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// connection operation through Network resource provider. + /// Parameters supplied to the create or update virtual network gateway + /// connection operation. /// public static VirtualNetworkGatewayConnection CreateOrUpdate(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put VirtualNetworkGatewayConnection operation creates/updates a - /// virtual network gateway connection in the specified resource group - /// through Network resource provider. + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. /// /// /// The operations group for this extension method. @@ -60,13 +53,13 @@ public static VirtualNetworkGatewayConnection CreateOrUpdate(this IVirtualNetwor /// The name of the virtual network gateway connection. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// connection operation through Network resource provider. + /// Parameters supplied to the create or update virtual network gateway + /// connection operation. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -75,9 +68,8 @@ public static VirtualNetworkGatewayConnection CreateOrUpdate(this IVirtualNetwor } /// - /// The Put VirtualNetworkGatewayConnection operation creates/updates a - /// virtual network gateway connection in the specified resource group - /// through Network resource provider. + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. /// /// /// The operations group for this extension method. @@ -89,18 +81,17 @@ public static VirtualNetworkGatewayConnection CreateOrUpdate(this IVirtualNetwor /// The name of the virtual network gateway connection. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// connection operation through Network resource provider. + /// Parameters supplied to the create or update virtual network gateway + /// connection operation. /// public static VirtualNetworkGatewayConnection BeginCreateOrUpdate(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put VirtualNetworkGatewayConnection operation creates/updates a - /// virtual network gateway connection in the specified resource group - /// through Network resource provider. + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. /// /// /// The operations group for this extension method. @@ -112,13 +103,13 @@ public static VirtualNetworkGatewayConnection BeginCreateOrUpdate(this IVirtualN /// The name of the virtual network gateway connection. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// connection operation through Network resource provider. + /// Parameters supplied to the create or update virtual network gateway + /// connection operation. /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -127,9 +118,7 @@ public static VirtualNetworkGatewayConnection BeginCreateOrUpdate(this IVirtualN } /// - /// The Get VirtualNetworkGatewayConnection operation retrieves information - /// about the specified virtual network gateway connection through Network - /// resource provider. + /// Gets the specified virtual network gateway connection by resource group. /// /// /// The operations group for this extension method. @@ -142,13 +131,11 @@ public static VirtualNetworkGatewayConnection BeginCreateOrUpdate(this IVirtualN /// public static VirtualNetworkGatewayConnection Get(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).GetAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).GetAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get VirtualNetworkGatewayConnection operation retrieves information - /// about the specified virtual network gateway connection through Network - /// resource provider. + /// Gets the specified virtual network gateway connection by resource group. /// /// /// The operations group for this extension method. @@ -162,7 +149,7 @@ public static VirtualNetworkGatewayConnection Get(this IVirtualNetworkGatewayCon /// /// The cancellation token. /// - public static async Task GetAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)) { @@ -171,8 +158,7 @@ public static VirtualNetworkGatewayConnection Get(this IVirtualNetworkGatewayCon } /// - /// The Delete VirtualNetworkGatewayConnection operation deletes the specified - /// virtual network Gateway connection through Network resource provider. + /// Deletes the specified virtual network Gateway connection. /// /// /// The operations group for this extension method. @@ -185,12 +171,11 @@ public static VirtualNetworkGatewayConnection Get(this IVirtualNetworkGatewayCon /// public static void Delete(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) { - Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).DeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).DeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete VirtualNetworkGatewayConnection operation deletes the specified - /// virtual network Gateway connection through Network resource provider. + /// Deletes the specified virtual network Gateway connection. /// /// /// The operations group for this extension method. @@ -204,14 +189,13 @@ public static void Delete(this IVirtualNetworkGatewayConnectionsOperations opera /// /// The cancellation token. /// - public static async Task DeleteAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Delete VirtualNetworkGatewayConnection operation deletes the specified - /// virtual network Gateway connection through Network resource provider. + /// Deletes the specified virtual network Gateway connection. /// /// /// The operations group for this extension method. @@ -224,12 +208,11 @@ public static void Delete(this IVirtualNetworkGatewayConnectionsOperations opera /// public static void BeginDelete(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) { - Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete VirtualNetworkGatewayConnection operation deletes the specified - /// virtual network Gateway connection through Network resource provider. + /// Deletes the specified virtual network Gateway connection. /// /// /// The operations group for this extension method. @@ -243,7 +226,7 @@ public static void BeginDelete(this IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false); } @@ -269,7 +252,7 @@ public static void BeginDelete(this IVirtualNetworkGatewayConnectionsOperations /// public static ConnectionSharedKey SetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).SetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).SetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -294,7 +277,7 @@ public static ConnectionSharedKey SetSharedKey(this IVirtualNetworkGatewayConnec /// /// The cancellation token. /// - public static async Task SetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task SetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.SetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -323,7 +306,7 @@ public static ConnectionSharedKey SetSharedKey(this IVirtualNetworkGatewayConnec /// public static ConnectionSharedKey BeginSetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -348,7 +331,7 @@ public static ConnectionSharedKey BeginSetSharedKey(this IVirtualNetworkGatewayC /// /// The cancellation token. /// - public static async Task BeginSetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginSetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginSetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -372,7 +355,7 @@ public static ConnectionSharedKey BeginSetSharedKey(this IVirtualNetworkGatewayC /// public static ConnectionSharedKey GetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).GetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).GetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -392,7 +375,7 @@ public static ConnectionSharedKey GetSharedKey(this IVirtualNetworkGatewayConnec /// /// The cancellation token. /// - public static async Task GetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)) { @@ -410,9 +393,9 @@ public static ConnectionSharedKey GetSharedKey(this IVirtualNetworkGatewayConnec /// /// The name of the resource group. /// - public static IPage List(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName) + public static Microsoft.Rest.Azure.IPage List(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -428,7 +411,7 @@ public static IPage List(this IVirtualNetworkGa /// /// The cancellation token. /// - public static async Task> ListAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { @@ -452,12 +435,12 @@ public static IPage List(this IVirtualNetworkGa /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the Begin Reset Virtual Network Gateway connection - /// shared key operation through Network resource provider. + /// Parameters supplied to the begin reset virtual network gateway connection + /// shared key operation through network resource provider. /// public static ConnectionResetSharedKey ResetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).ResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).ResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -476,13 +459,13 @@ public static ConnectionResetSharedKey ResetSharedKey(this IVirtualNetworkGatewa /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the Begin Reset Virtual Network Gateway connection - /// shared key operation through Network resource provider. + /// Parameters supplied to the begin reset virtual network gateway connection + /// shared key operation through network resource provider. /// /// /// The cancellation token. /// - public static async Task ResetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task ResetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ResetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -506,12 +489,12 @@ public static ConnectionResetSharedKey ResetSharedKey(this IVirtualNetworkGatewa /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the Begin Reset Virtual Network Gateway connection - /// shared key operation through Network resource provider. + /// Parameters supplied to the begin reset virtual network gateway connection + /// shared key operation through network resource provider. /// public static ConnectionResetSharedKey BeginResetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -530,13 +513,13 @@ public static ConnectionResetSharedKey BeginResetSharedKey(this IVirtualNetworkG /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the Begin Reset Virtual Network Gateway connection - /// shared key operation through Network resource provider. + /// Parameters supplied to the begin reset virtual network gateway connection + /// shared key operation through network resource provider. /// /// /// The cancellation token. /// - public static async Task BeginResetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginResetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginResetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -554,9 +537,9 @@ public static ConnectionResetSharedKey BeginResetSharedKey(this IVirtualNetworkG /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this IVirtualNetworkGatewayConnectionsOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualNetworkGatewayConnectionsOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -572,7 +555,7 @@ public static IPage ListNext(this IVirtualNetwo /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperations.cs index c4eecd1356fb3..02bf147063af0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperations.cs @@ -2,32 +2,21 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; using System.Linq; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using Microsoft.Rest.Azure; using Models; /// /// VirtualNetworkGatewaysOperations operations. /// - internal partial class VirtualNetworkGatewaysOperations : IServiceOperations, IVirtualNetworkGatewaysOperations + internal partial class VirtualNetworkGatewaysOperations : Microsoft.Rest.IServiceOperations, IVirtualNetworkGatewaysOperations { /// /// Initializes a new instance of the VirtualNetworkGatewaysOperations class. @@ -35,11 +24,14 @@ internal partial class VirtualNetworkGatewaysOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } this.Client = client; } @@ -50,8 +42,8 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The Put VirtualNetworkGateway operation creates/updates a virtual network - /// gateway in the specified resource group through Network resource provider. + /// Creates or updates a virtual network gateway in the specified resource + /// group. /// /// /// The name of the resource group. @@ -60,8 +52,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// operation through Network resource provider. + /// Parameters supplied to create or update virtual network gateway operation. /// /// /// The headers that will be added to request. @@ -69,10 +60,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, virtualNetworkGatewayName, parameters, customHeaders, cancellationToken); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, @@ -80,8 +71,8 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) } /// - /// The Put VirtualNetworkGateway operation creates/updates a virtual network - /// gateway in the specified resource group through Network resource provider. + /// Creates or updates a virtual network gateway in the specified resource + /// group. /// /// /// The name of the resource group. @@ -90,8 +81,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// operation through Network resource provider. + /// Parameters supplied to create or update virtual network gateway operation. /// /// /// Headers that will be added to request. @@ -99,22 +89,31 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } if (parameters != null) { @@ -122,49 +121,49 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayName}", Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -190,9 +189,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) string _requestContent = null; if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) @@ -203,43 +202,43 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -249,7 +248,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -262,16 +261,16 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -280,28 +279,27 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Get VirtualNetworkGateway operation retrieves information about the - /// specified virtual network gateway through Network resource provider. + /// Gets the specified virtual network gateway by resource group. /// /// /// The name of the resource group. @@ -315,63 +313,72 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayName}", Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -404,43 +411,43 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -450,7 +457,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -463,28 +470,27 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Delete VirtualNetworkGateway operation deletes the specified virtual - /// network Gateway through Network resource provider. + /// Deletes the specified virtual network gateway. /// /// /// The name of the resource group. @@ -498,17 +504,16 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, virtualNetworkGatewayName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The Delete VirtualNetworkGateway operation deletes the specified virtual - /// network Gateway through Network resource provider. + /// Deletes the specified virtual network gateway. /// /// /// The name of the resource group. @@ -522,63 +527,69 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayName}", Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -611,30 +622,35 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -644,7 +660,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -653,14 +669,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List VirtualNetworkGateways operation retrieves all the virtual - /// network gateways stored. + /// Gets all virtual network gateways by resource group. /// /// /// The name of the resource group. @@ -671,57 +686,66 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -754,43 +778,43 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -800,7 +824,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -813,29 +837,28 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Reset VirtualNetworkGateway operation resets the primary of the - /// virtual network gateway in the specified resource group through Network - /// resource provider. + /// Resets the primary of the virtual network gateway in the specified + /// resource group. /// /// /// The name of the resource group. @@ -844,8 +867,8 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// The name of the virtual network gateway. /// /// - /// Virtual network gateway vip address supplied to the Begin Reset of - /// Active-Active feature enabled Gateway. + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. /// /// /// The headers that will be added to request. @@ -853,18 +876,17 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> ResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginResetWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginResetWithHttpMessagesAsync( resourceGroupName, virtualNetworkGatewayName, gatewayVip, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The Reset VirtualNetworkGateway operation resets the primary of the - /// virtual network gateway in the specified resource group through Network - /// resource provider. + /// Resets the primary of the virtual network gateway in the specified + /// resource group. /// /// /// The name of the resource group. @@ -873,8 +895,8 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// The name of the virtual network gateway. /// /// - /// Virtual network gateway vip address supplied to the Begin Reset of - /// Active-Active feature enabled Gateway. + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. /// /// /// Headers that will be added to request. @@ -882,68 +904,77 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("gatewayVip", gatewayVip); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginReset", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginReset", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayName}", Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (gatewayVip != null) { - _queryParameters.Add(string.Format("gatewayVip={0}", Uri.EscapeDataString(gatewayVip))); + _queryParameters.Add(string.Format("gatewayVip={0}", System.Uri.EscapeDataString(gatewayVip))); } if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -976,43 +1007,43 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 202 && (int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1022,7 +1053,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1035,29 +1066,28 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Generatevpnclientpackage operation generates Vpn client package for - /// P2S client of the virtual network gateway in the specified resource group - /// through Network resource provider. + /// Generates VPN client package for P2S client of the virtual network gateway + /// in the specified resource group. /// /// /// The name of the resource group. @@ -1066,8 +1096,8 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the Begin Generating Virtual Network Gateway Vpn - /// client package operation through Network resource provider. + /// Parameters supplied to the generate virtual network gateway VPN client + /// package operation. /// /// /// Headers that will be added to request. @@ -1075,22 +1105,31 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GeneratevpnclientpackageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GeneratevpnclientpackageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } if (parameters != null) { @@ -1098,49 +1137,49 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Generatevpnclientpackage", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Generatevpnclientpackage", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayName}", Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1166,9 +1205,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) string _requestContent = null; if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) @@ -1179,43 +1218,43 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1225,7 +1264,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1238,28 +1277,27 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List VirtualNetworkGateways operation retrieves all the virtual - /// network gateways stored. + /// Gets all virtual network gateways by resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -1270,43 +1308,52 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1339,43 +1386,43 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1385,7 +1432,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1398,21 +1445,21 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs index 7480e0a4eb577..3f0b46eeba46b 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs @@ -2,20 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; + using Microsoft.Rest.Azure; + using Models; /// /// Extension methods for VirtualNetworkGatewaysOperations. @@ -23,8 +18,8 @@ namespace Microsoft.Azure.Management.Network public static partial class VirtualNetworkGatewaysOperationsExtensions { /// - /// The Put VirtualNetworkGateway operation creates/updates a virtual network - /// gateway in the specified resource group through Network resource provider. + /// Creates or updates a virtual network gateway in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -36,17 +31,16 @@ public static partial class VirtualNetworkGatewaysOperationsExtensions /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// operation through Network resource provider. + /// Parameters supplied to create or update virtual network gateway operation. /// public static VirtualNetworkGateway CreateOrUpdate(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put VirtualNetworkGateway operation creates/updates a virtual network - /// gateway in the specified resource group through Network resource provider. + /// Creates or updates a virtual network gateway in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -58,13 +52,12 @@ public static VirtualNetworkGateway CreateOrUpdate(this IVirtualNetworkGatewaysO /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// operation through Network resource provider. + /// Parameters supplied to create or update virtual network gateway operation. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -73,8 +66,8 @@ public static VirtualNetworkGateway CreateOrUpdate(this IVirtualNetworkGatewaysO } /// - /// The Put VirtualNetworkGateway operation creates/updates a virtual network - /// gateway in the specified resource group through Network resource provider. + /// Creates or updates a virtual network gateway in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -86,17 +79,16 @@ public static VirtualNetworkGateway CreateOrUpdate(this IVirtualNetworkGatewaysO /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// operation through Network resource provider. + /// Parameters supplied to create or update virtual network gateway operation. /// public static VirtualNetworkGateway BeginCreateOrUpdate(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put VirtualNetworkGateway operation creates/updates a virtual network - /// gateway in the specified resource group through Network resource provider. + /// Creates or updates a virtual network gateway in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -108,13 +100,12 @@ public static VirtualNetworkGateway BeginCreateOrUpdate(this IVirtualNetworkGate /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// operation through Network resource provider. + /// Parameters supplied to create or update virtual network gateway operation. /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -123,8 +114,7 @@ public static VirtualNetworkGateway BeginCreateOrUpdate(this IVirtualNetworkGate } /// - /// The Get VirtualNetworkGateway operation retrieves information about the - /// specified virtual network gateway through Network resource provider. + /// Gets the specified virtual network gateway by resource group. /// /// /// The operations group for this extension method. @@ -137,12 +127,11 @@ public static VirtualNetworkGateway BeginCreateOrUpdate(this IVirtualNetworkGate /// public static VirtualNetworkGateway Get(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).GetAsync(resourceGroupName, virtualNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).GetAsync(resourceGroupName, virtualNetworkGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get VirtualNetworkGateway operation retrieves information about the - /// specified virtual network gateway through Network resource provider. + /// Gets the specified virtual network gateway by resource group. /// /// /// The operations group for this extension method. @@ -156,7 +145,7 @@ public static VirtualNetworkGateway Get(this IVirtualNetworkGatewaysOperations o /// /// The cancellation token. /// - public static async Task GetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) { @@ -165,8 +154,7 @@ public static VirtualNetworkGateway Get(this IVirtualNetworkGatewaysOperations o } /// - /// The Delete VirtualNetworkGateway operation deletes the specified virtual - /// network Gateway through Network resource provider. + /// Deletes the specified virtual network gateway. /// /// /// The operations group for this extension method. @@ -179,12 +167,11 @@ public static VirtualNetworkGateway Get(this IVirtualNetworkGatewaysOperations o /// public static void Delete(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) { - Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).DeleteAsync(resourceGroupName, virtualNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).DeleteAsync(resourceGroupName, virtualNetworkGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete VirtualNetworkGateway operation deletes the specified virtual - /// network Gateway through Network resource provider. + /// Deletes the specified virtual network gateway. /// /// /// The operations group for this extension method. @@ -198,14 +185,13 @@ public static void Delete(this IVirtualNetworkGatewaysOperations operations, str /// /// The cancellation token. /// - public static async Task DeleteAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Delete VirtualNetworkGateway operation deletes the specified virtual - /// network Gateway through Network resource provider. + /// Deletes the specified virtual network gateway. /// /// /// The operations group for this extension method. @@ -218,12 +204,11 @@ public static void Delete(this IVirtualNetworkGatewaysOperations operations, str /// public static void BeginDelete(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) { - Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete VirtualNetworkGateway operation deletes the specified virtual - /// network Gateway through Network resource provider. + /// Deletes the specified virtual network gateway. /// /// /// The operations group for this extension method. @@ -237,14 +222,13 @@ public static void BeginDelete(this IVirtualNetworkGatewaysOperations operations /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// The List VirtualNetworkGateways operation retrieves all the virtual - /// network gateways stored. + /// Gets all virtual network gateways by resource group. /// /// /// The operations group for this extension method. @@ -252,14 +236,13 @@ public static void BeginDelete(this IVirtualNetworkGatewaysOperations operations /// /// The name of the resource group. /// - public static IPage List(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName) + public static Microsoft.Rest.Azure.IPage List(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List VirtualNetworkGateways operation retrieves all the virtual - /// network gateways stored. + /// Gets all virtual network gateways by resource group. /// /// /// The operations group for this extension method. @@ -270,7 +253,7 @@ public static IPage List(this IVirtualNetworkGatewaysOper /// /// The cancellation token. /// - public static async Task> ListAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { @@ -279,9 +262,8 @@ public static IPage List(this IVirtualNetworkGatewaysOper } /// - /// The Reset VirtualNetworkGateway operation resets the primary of the - /// virtual network gateway in the specified resource group through Network - /// resource provider. + /// Resets the primary of the virtual network gateway in the specified + /// resource group. /// /// /// The operations group for this extension method. @@ -293,18 +275,17 @@ public static IPage List(this IVirtualNetworkGatewaysOper /// The name of the virtual network gateway. /// /// - /// Virtual network gateway vip address supplied to the Begin Reset of - /// Active-Active feature enabled Gateway. + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. /// public static VirtualNetworkGateway Reset(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string)) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Reset VirtualNetworkGateway operation resets the primary of the - /// virtual network gateway in the specified resource group through Network - /// resource provider. + /// Resets the primary of the virtual network gateway in the specified + /// resource group. /// /// /// The operations group for this extension method. @@ -316,13 +297,13 @@ public static IPage List(this IVirtualNetworkGatewaysOper /// The name of the virtual network gateway. /// /// - /// Virtual network gateway vip address supplied to the Begin Reset of - /// Active-Active feature enabled Gateway. + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. /// /// /// The cancellation token. /// - public static async Task ResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task ResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, null, cancellationToken).ConfigureAwait(false)) { @@ -331,9 +312,8 @@ public static IPage List(this IVirtualNetworkGatewaysOper } /// - /// The Reset VirtualNetworkGateway operation resets the primary of the - /// virtual network gateway in the specified resource group through Network - /// resource provider. + /// Resets the primary of the virtual network gateway in the specified + /// resource group. /// /// /// The operations group for this extension method. @@ -345,18 +325,17 @@ public static IPage List(this IVirtualNetworkGatewaysOper /// The name of the virtual network gateway. /// /// - /// Virtual network gateway vip address supplied to the Begin Reset of - /// Active-Active feature enabled Gateway. + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. /// public static VirtualNetworkGateway BeginReset(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string)) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Reset VirtualNetworkGateway operation resets the primary of the - /// virtual network gateway in the specified resource group through Network - /// resource provider. + /// Resets the primary of the virtual network gateway in the specified + /// resource group. /// /// /// The operations group for this extension method. @@ -368,13 +347,13 @@ public static IPage List(this IVirtualNetworkGatewaysOper /// The name of the virtual network gateway. /// /// - /// Virtual network gateway vip address supplied to the Begin Reset of - /// Active-Active feature enabled Gateway. + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. /// /// /// The cancellation token. /// - public static async Task BeginResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, null, cancellationToken).ConfigureAwait(false)) { @@ -383,9 +362,8 @@ public static IPage List(this IVirtualNetworkGatewaysOper } /// - /// The Generatevpnclientpackage operation generates Vpn client package for - /// P2S client of the virtual network gateway in the specified resource group - /// through Network resource provider. + /// Generates VPN client package for P2S client of the virtual network gateway + /// in the specified resource group. /// /// /// The operations group for this extension method. @@ -397,18 +375,17 @@ public static IPage List(this IVirtualNetworkGatewaysOper /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the Begin Generating Virtual Network Gateway Vpn - /// client package operation through Network resource provider. + /// Parameters supplied to the generate virtual network gateway VPN client + /// package operation. /// public static string Generatevpnclientpackage(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).GeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).GeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Generatevpnclientpackage operation generates Vpn client package for - /// P2S client of the virtual network gateway in the specified resource group - /// through Network resource provider. + /// Generates VPN client package for P2S client of the virtual network gateway + /// in the specified resource group. /// /// /// The operations group for this extension method. @@ -420,13 +397,13 @@ public static string Generatevpnclientpackage(this IVirtualNetworkGatewaysOperat /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the Begin Generating Virtual Network Gateway Vpn - /// client package operation through Network resource provider. + /// Parameters supplied to the generate virtual network gateway VPN client + /// package operation. /// /// /// The cancellation token. /// - public static async Task GeneratevpnclientpackageAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GeneratevpnclientpackageAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GeneratevpnclientpackageWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -435,8 +412,7 @@ public static string Generatevpnclientpackage(this IVirtualNetworkGatewaysOperat } /// - /// The List VirtualNetworkGateways operation retrieves all the virtual - /// network gateways stored. + /// Gets all virtual network gateways by resource group. /// /// /// The operations group for this extension method. @@ -444,14 +420,13 @@ public static string Generatevpnclientpackage(this IVirtualNetworkGatewaysOperat /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this IVirtualNetworkGatewaysOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualNetworkGatewaysOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List VirtualNetworkGateways operation retrieves all the virtual - /// network gateways stored. + /// Gets all virtual network gateways by resource group. /// /// /// The operations group for this extension method. @@ -462,7 +437,7 @@ public static IPage ListNext(this IVirtualNetworkGateways /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IVirtualNetworkGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this IVirtualNetworkGatewaysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperations.cs index da18da393dd6d..688aa160eba10 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperations.cs @@ -2,32 +2,21 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; using System.Linq; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using Microsoft.Rest.Azure; using Models; /// /// VirtualNetworkPeeringsOperations operations. /// - internal partial class VirtualNetworkPeeringsOperations : IServiceOperations, IVirtualNetworkPeeringsOperations + internal partial class VirtualNetworkPeeringsOperations : Microsoft.Rest.IServiceOperations, IVirtualNetworkPeeringsOperations { /// /// Initializes a new instance of the VirtualNetworkPeeringsOperations class. @@ -35,11 +24,14 @@ internal partial class VirtualNetworkPeeringsOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } this.Client = client; } @@ -50,7 +42,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The delete virtual network peering operation deletes the specified peering. + /// Deletes the specified virtual network peering. /// /// /// The name of the resource group. @@ -67,16 +59,16 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete virtual network peering operation deletes the specified peering. + /// Deletes the specified virtual network peering. /// /// /// The name of the resource group. @@ -93,69 +85,75 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } if (virtualNetworkPeeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("virtualNetworkPeeringName", virtualNetworkPeeringName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{virtualNetworkPeeringName}", Uri.EscapeDataString(virtualNetworkPeeringName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{virtualNetworkPeeringName}", System.Uri.EscapeDataString(virtualNetworkPeeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -188,30 +186,35 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -221,7 +224,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -230,14 +233,13 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Get virtual network peering operation retrieves information about the - /// specified virtual network peering. + /// Gets the specified virtual network peering. /// /// /// The name of the resource group. @@ -254,69 +256,78 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } if (virtualNetworkPeeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("virtualNetworkPeeringName", virtualNetworkPeeringName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{virtualNetworkPeeringName}", Uri.EscapeDataString(virtualNetworkPeeringName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{virtualNetworkPeeringName}", System.Uri.EscapeDataString(virtualNetworkPeeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -349,43 +360,43 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -395,7 +406,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -408,28 +419,27 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Put virtual network peering operation creates/updates a peering in the - /// specified virtual network + /// Creates or updates a peering in the specified virtual network. /// /// /// The name of the resource group. @@ -441,7 +451,8 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// The name of the peering. /// /// - /// Parameters supplied to the create/update virtual network peering operation + /// Parameters supplied to the create or update virtual network peering + /// operation. /// /// /// The headers that will be added to request. @@ -449,10 +460,10 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, customHeaders, cancellationToken); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, @@ -460,8 +471,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) } /// - /// The Put virtual network peering operation creates/updates a peering in the - /// specified virtual network + /// Creates or updates a peering in the specified virtual network. /// /// /// The name of the resource group. @@ -473,7 +483,8 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// The name of the peering. /// /// - /// Parameters supplied to the create/update virtual network peering operation + /// Parameters supplied to the create or update virtual network peering + /// operation. /// /// /// Headers that will be added to request. @@ -481,74 +492,83 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } if (virtualNetworkPeeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); } if (virtualNetworkPeeringParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkPeeringParameters"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("virtualNetworkPeeringName", virtualNetworkPeeringName); tracingParameters.Add("virtualNetworkPeeringParameters", virtualNetworkPeeringParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{virtualNetworkPeeringName}", Uri.EscapeDataString(virtualNetworkPeeringName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{virtualNetworkPeeringName}", System.Uri.EscapeDataString(virtualNetworkPeeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -574,9 +594,9 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) string _requestContent = null; if(virtualNetworkPeeringParameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(virtualNetworkPeeringParameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(virtualNetworkPeeringParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) @@ -587,43 +607,43 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -633,7 +653,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -646,16 +666,16 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -664,28 +684,27 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List virtual network peerings operation retrieves all the peerings in - /// a virtual network. + /// Gets all virtual network peerings in a virtual network. /// /// /// The name of the resource group. @@ -699,63 +718,72 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -788,43 +816,43 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -834,7 +862,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -847,28 +875,27 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List virtual network peerings operation retrieves all the peerings in - /// a virtual network. + /// Gets all virtual network peerings in a virtual network. /// /// /// The NextLink from the previous successful call to List operation. @@ -879,43 +906,52 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -948,43 +984,43 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -994,7 +1030,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1007,21 +1043,21 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperationsExtensions.cs index 82c61ed739f19..a30a307d8fc6a 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperationsExtensions.cs @@ -2,20 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; + using Microsoft.Rest.Azure; + using Models; /// /// Extension methods for VirtualNetworkPeeringsOperations. @@ -23,7 +18,7 @@ namespace Microsoft.Azure.Management.Network public static partial class VirtualNetworkPeeringsOperationsExtensions { /// - /// The delete virtual network peering operation deletes the specified peering. + /// Deletes the specified virtual network peering. /// /// /// The operations group for this extension method. @@ -39,11 +34,11 @@ public static partial class VirtualNetworkPeeringsOperationsExtensions /// public static void Delete(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName) { - Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).DeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).DeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete virtual network peering operation deletes the specified peering. + /// Deletes the specified virtual network peering. /// /// /// The operations group for this extension method. @@ -60,13 +55,13 @@ public static void Delete(this IVirtualNetworkPeeringsOperations operations, str /// /// The cancellation token. /// - public static async Task DeleteAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, null, cancellationToken).ConfigureAwait(false); } /// - /// The delete virtual network peering operation deletes the specified peering. + /// Deletes the specified virtual network peering. /// /// /// The operations group for this extension method. @@ -82,11 +77,11 @@ public static void Delete(this IVirtualNetworkPeeringsOperations operations, str /// public static void BeginDelete(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName) { - Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete virtual network peering operation deletes the specified peering. + /// Deletes the specified virtual network peering. /// /// /// The operations group for this extension method. @@ -103,14 +98,13 @@ public static void BeginDelete(this IVirtualNetworkPeeringsOperations operations /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Get virtual network peering operation retrieves information about the - /// specified virtual network peering. + /// Gets the specified virtual network peering. /// /// /// The operations group for this extension method. @@ -126,12 +120,11 @@ public static void BeginDelete(this IVirtualNetworkPeeringsOperations operations /// public static VirtualNetworkPeering Get(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName) { - return Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).GetAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).GetAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get virtual network peering operation retrieves information about the - /// specified virtual network peering. + /// Gets the specified virtual network peering. /// /// /// The operations group for this extension method. @@ -148,7 +141,7 @@ public static VirtualNetworkPeering Get(this IVirtualNetworkPeeringsOperations o /// /// The cancellation token. /// - public static async Task GetAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, null, cancellationToken).ConfigureAwait(false)) { @@ -157,8 +150,7 @@ public static VirtualNetworkPeering Get(this IVirtualNetworkPeeringsOperations o } /// - /// The Put virtual network peering operation creates/updates a peering in the - /// specified virtual network + /// Creates or updates a peering in the specified virtual network. /// /// /// The operations group for this extension method. @@ -173,16 +165,16 @@ public static VirtualNetworkPeering Get(this IVirtualNetworkPeeringsOperations o /// The name of the peering. /// /// - /// Parameters supplied to the create/update virtual network peering operation + /// Parameters supplied to the create or update virtual network peering + /// operation. /// public static VirtualNetworkPeering CreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put virtual network peering operation creates/updates a peering in the - /// specified virtual network + /// Creates or updates a peering in the specified virtual network. /// /// /// The operations group for this extension method. @@ -197,12 +189,13 @@ public static VirtualNetworkPeering CreateOrUpdate(this IVirtualNetworkPeeringsO /// The name of the peering. /// /// - /// Parameters supplied to the create/update virtual network peering operation + /// Parameters supplied to the create or update virtual network peering + /// operation. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, null, cancellationToken).ConfigureAwait(false)) { @@ -211,8 +204,7 @@ public static VirtualNetworkPeering CreateOrUpdate(this IVirtualNetworkPeeringsO } /// - /// The Put virtual network peering operation creates/updates a peering in the - /// specified virtual network + /// Creates or updates a peering in the specified virtual network. /// /// /// The operations group for this extension method. @@ -227,16 +219,16 @@ public static VirtualNetworkPeering CreateOrUpdate(this IVirtualNetworkPeeringsO /// The name of the peering. /// /// - /// Parameters supplied to the create/update virtual network peering operation + /// Parameters supplied to the create or update virtual network peering + /// operation. /// public static VirtualNetworkPeering BeginCreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put virtual network peering operation creates/updates a peering in the - /// specified virtual network + /// Creates or updates a peering in the specified virtual network. /// /// /// The operations group for this extension method. @@ -251,12 +243,13 @@ public static VirtualNetworkPeering BeginCreateOrUpdate(this IVirtualNetworkPeer /// The name of the peering. /// /// - /// Parameters supplied to the create/update virtual network peering operation + /// Parameters supplied to the create or update virtual network peering + /// operation. /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, null, cancellationToken).ConfigureAwait(false)) { @@ -265,8 +258,7 @@ public static VirtualNetworkPeering BeginCreateOrUpdate(this IVirtualNetworkPeer } /// - /// The List virtual network peerings operation retrieves all the peerings in - /// a virtual network. + /// Gets all virtual network peerings in a virtual network. /// /// /// The operations group for this extension method. @@ -277,14 +269,13 @@ public static VirtualNetworkPeering BeginCreateOrUpdate(this IVirtualNetworkPeer /// /// The name of the virtual network. /// - public static IPage List(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName) + public static Microsoft.Rest.Azure.IPage List(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName) { - return Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).ListAsync(resourceGroupName, virtualNetworkName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).ListAsync(resourceGroupName, virtualNetworkName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List virtual network peerings operation retrieves all the peerings in - /// a virtual network. + /// Gets all virtual network peerings in a virtual network. /// /// /// The operations group for this extension method. @@ -298,7 +289,7 @@ public static IPage List(this IVirtualNetworkPeeringsOper /// /// The cancellation token. /// - public static async Task> ListAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)) { @@ -307,8 +298,7 @@ public static IPage List(this IVirtualNetworkPeeringsOper } /// - /// The List virtual network peerings operation retrieves all the peerings in - /// a virtual network. + /// Gets all virtual network peerings in a virtual network. /// /// /// The operations group for this extension method. @@ -316,14 +306,13 @@ public static IPage List(this IVirtualNetworkPeeringsOper /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this IVirtualNetworkPeeringsOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualNetworkPeeringsOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List virtual network peerings operation retrieves all the peerings in - /// a virtual network. + /// Gets all virtual network peerings in a virtual network. /// /// /// The operations group for this extension method. @@ -334,7 +323,7 @@ public static IPage ListNext(this IVirtualNetworkPeerings /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IVirtualNetworkPeeringsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this IVirtualNetworkPeeringsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperations.cs index dc0e178f35f51..b8d0b45621e69 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperations.cs @@ -2,32 +2,21 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; using System.Linq; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using Microsoft.Rest.Azure; using Models; /// /// VirtualNetworksOperations operations. /// - internal partial class VirtualNetworksOperations : IServiceOperations, IVirtualNetworksOperations + internal partial class VirtualNetworksOperations : Microsoft.Rest.IServiceOperations, IVirtualNetworksOperations { /// /// Initializes a new instance of the VirtualNetworksOperations class. @@ -35,11 +24,14 @@ internal partial class VirtualNetworksOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal VirtualNetworksOperations(NetworkManagementClient client) { if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } this.Client = client; } @@ -50,7 +42,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The Delete VirtualNetwork operation deletes the specified virtual network + /// Deletes the specified virtual network. /// /// /// The name of the resource group. @@ -64,16 +56,16 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, virtualNetworkName, customHeaders, cancellationToken); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The Delete VirtualNetwork operation deletes the specified virtual network + /// Deletes the specified virtual network. /// /// /// The name of the resource group. @@ -87,63 +79,69 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -176,30 +174,35 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 202 && (int)_statusCode != 204 && (int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -209,7 +212,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -218,14 +221,13 @@ internal VirtualNetworksOperations(NetworkManagementClient client) } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Get VirtualNetwork operation retrieves information about the specified - /// virtual network. + /// Gets the specified virtual network by resource group. /// /// /// The name of the resource group. @@ -234,7 +236,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// The name of the virtual network. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// Headers that will be added to request. @@ -242,68 +244,77 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (expand != null) { - _queryParameters.Add(string.Format("$expand={0}", Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -336,43 +347,43 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -382,7 +393,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -395,28 +406,27 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Put VirtualNetwork operation creates/updates a virtual network in the - /// specified resource group. + /// Creates or updates a virtual network in the specified resource group. /// /// /// The name of the resource group. @@ -425,7 +435,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// The name of the virtual network. /// /// - /// Parameters supplied to the create/update Virtual Network operation + /// Parameters supplied to the create or update virtual network operation /// /// /// The headers that will be added to request. @@ -433,10 +443,10 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, virtualNetworkName, parameters, customHeaders, cancellationToken); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, @@ -444,8 +454,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) } /// - /// The Put VirtualNetwork operation creates/updates a virtual network in the - /// specified resource group. + /// Creates or updates a virtual network in the specified resource group. /// /// /// The name of the resource group. @@ -454,7 +463,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// The name of the virtual network. /// /// - /// Parameters supplied to the create/update Virtual Network operation + /// Parameters supplied to the create or update virtual network operation /// /// /// Headers that will be added to request. @@ -462,68 +471,77 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -549,9 +567,9 @@ internal VirtualNetworksOperations(NetworkManagementClient client) string _requestContent = null; if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (this.Client.Credentials != null) @@ -562,43 +580,43 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -608,7 +626,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -621,16 +639,16 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -639,27 +657,27 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The list VirtualNetwork returns all Virtual Networks in a subscription + /// Gets all virtual networks in a subscription. /// /// /// Headers that will be added to request. @@ -667,51 +685,60 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -744,43 +771,43 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -790,7 +817,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -803,27 +830,27 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The list VirtualNetwork returns all Virtual Networks in a resource group + /// Gets all virtual networks in a resource group. /// /// /// The name of the resource group. @@ -834,57 +861,66 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -917,43 +953,43 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -963,7 +999,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -976,27 +1012,27 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Checks whether a private Ip address is available for use. + /// Checks whether a private IP address is available for use. /// /// /// The name of the resource group. @@ -1013,68 +1049,77 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> CheckIPAddressAvailabilityWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string ipAddress = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckIPAddressAvailabilityWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string ipAddress = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); } if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("ipAddress", ipAddress); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckIPAddressAvailability", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckIPAddressAvailability", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - List _queryParameters = new List(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (ipAddress != null) { - _queryParameters.Add(string.Format("ipAddress={0}", Uri.EscapeDataString(ipAddress))); + _queryParameters.Add(string.Format("ipAddress={0}", System.Uri.EscapeDataString(ipAddress))); } if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1107,43 +1152,43 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1153,7 +1198,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1166,27 +1211,27 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The list VirtualNetwork returns all Virtual Networks in a subscription + /// Gets all virtual networks in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -1197,43 +1242,52 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1266,43 +1320,43 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1312,7 +1366,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1325,27 +1379,27 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The list VirtualNetwork returns all Virtual Networks in a resource group + /// Gets all virtual networks in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -1356,43 +1410,52 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (this.Client.AcceptLanguage != null) { @@ -1425,43 +1488,43 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1471,7 +1534,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1484,21 +1547,21 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperationsExtensions.cs index 9bbf0cced5677..c869a57ef5452 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperationsExtensions.cs @@ -2,20 +2,15 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; + using Microsoft.Rest.Azure; + using Models; /// /// Extension methods for VirtualNetworksOperations. @@ -23,7 +18,7 @@ namespace Microsoft.Azure.Management.Network public static partial class VirtualNetworksOperationsExtensions { /// - /// The Delete VirtualNetwork operation deletes the specified virtual network + /// Deletes the specified virtual network. /// /// /// The operations group for this extension method. @@ -36,11 +31,11 @@ public static partial class VirtualNetworksOperationsExtensions /// public static void Delete(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName) { - Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).DeleteAsync(resourceGroupName, virtualNetworkName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).DeleteAsync(resourceGroupName, virtualNetworkName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete VirtualNetwork operation deletes the specified virtual network + /// Deletes the specified virtual network. /// /// /// The operations group for this extension method. @@ -54,13 +49,13 @@ public static void Delete(this IVirtualNetworksOperations operations, string res /// /// The cancellation token. /// - public static async Task DeleteAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Delete VirtualNetwork operation deletes the specified virtual network + /// Deletes the specified virtual network. /// /// /// The operations group for this extension method. @@ -73,11 +68,11 @@ public static void Delete(this IVirtualNetworksOperations operations, string res /// public static void BeginDelete(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName) { - Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete VirtualNetwork operation deletes the specified virtual network + /// Deletes the specified virtual network. /// /// /// The operations group for this extension method. @@ -91,14 +86,13 @@ public static void BeginDelete(this IVirtualNetworksOperations operations, strin /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Get VirtualNetwork operation retrieves information about the specified - /// virtual network. + /// Gets the specified virtual network by resource group. /// /// /// The operations group for this extension method. @@ -110,16 +104,15 @@ public static void BeginDelete(this IVirtualNetworksOperations operations, strin /// The name of the virtual network. /// /// - /// expand references resources. + /// Expands referenced resources. /// public static VirtualNetwork Get(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string expand = default(string)) { - return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).GetAsync(resourceGroupName, virtualNetworkName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).GetAsync(resourceGroupName, virtualNetworkName, expand), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get VirtualNetwork operation retrieves information about the specified - /// virtual network. + /// Gets the specified virtual network by resource group. /// /// /// The operations group for this extension method. @@ -131,12 +124,12 @@ public static void BeginDelete(this IVirtualNetworksOperations operations, strin /// The name of the virtual network. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// The cancellation token. /// - public static async Task GetAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, expand, null, cancellationToken).ConfigureAwait(false)) { @@ -145,8 +138,7 @@ public static void BeginDelete(this IVirtualNetworksOperations operations, strin } /// - /// The Put VirtualNetwork operation creates/updates a virtual network in the - /// specified resource group. + /// Creates or updates a virtual network in the specified resource group. /// /// /// The operations group for this extension method. @@ -158,16 +150,15 @@ public static void BeginDelete(this IVirtualNetworksOperations operations, strin /// The name of the virtual network. /// /// - /// Parameters supplied to the create/update Virtual Network operation + /// Parameters supplied to the create or update virtual network operation /// public static VirtualNetwork CreateOrUpdate(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put VirtualNetwork operation creates/updates a virtual network in the - /// specified resource group. + /// Creates or updates a virtual network in the specified resource group. /// /// /// The operations group for this extension method. @@ -179,12 +170,12 @@ public static VirtualNetwork CreateOrUpdate(this IVirtualNetworksOperations oper /// The name of the virtual network. /// /// - /// Parameters supplied to the create/update Virtual Network operation + /// Parameters supplied to the create or update virtual network operation /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -193,8 +184,7 @@ public static VirtualNetwork CreateOrUpdate(this IVirtualNetworksOperations oper } /// - /// The Put VirtualNetwork operation creates/updates a virtual network in the - /// specified resource group. + /// Creates or updates a virtual network in the specified resource group. /// /// /// The operations group for this extension method. @@ -206,16 +196,15 @@ public static VirtualNetwork CreateOrUpdate(this IVirtualNetworksOperations oper /// The name of the virtual network. /// /// - /// Parameters supplied to the create/update Virtual Network operation + /// Parameters supplied to the create or update virtual network operation /// public static VirtualNetwork BeginCreateOrUpdate(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put VirtualNetwork operation creates/updates a virtual network in the - /// specified resource group. + /// Creates or updates a virtual network in the specified resource group. /// /// /// The operations group for this extension method. @@ -227,12 +216,12 @@ public static VirtualNetwork BeginCreateOrUpdate(this IVirtualNetworksOperations /// The name of the virtual network. /// /// - /// Parameters supplied to the create/update Virtual Network operation + /// Parameters supplied to the create or update virtual network operation /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -241,18 +230,18 @@ public static VirtualNetwork BeginCreateOrUpdate(this IVirtualNetworksOperations } /// - /// The list VirtualNetwork returns all Virtual Networks in a subscription + /// Gets all virtual networks in a subscription. /// /// /// The operations group for this extension method. /// - public static IPage ListAll(this IVirtualNetworksOperations operations) + public static Microsoft.Rest.Azure.IPage ListAll(this IVirtualNetworksOperations operations) { - return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).ListAllAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list VirtualNetwork returns all Virtual Networks in a subscription + /// Gets all virtual networks in a subscription. /// /// /// The operations group for this extension method. @@ -260,7 +249,7 @@ public static IPage ListAll(this IVirtualNetworksOperations oper /// /// The cancellation token. /// - public static async Task> ListAllAsync(this IVirtualNetworksOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllAsync(this IVirtualNetworksOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -269,7 +258,7 @@ public static IPage ListAll(this IVirtualNetworksOperations oper } /// - /// The list VirtualNetwork returns all Virtual Networks in a resource group + /// Gets all virtual networks in a resource group. /// /// /// The operations group for this extension method. @@ -277,13 +266,13 @@ public static IPage ListAll(this IVirtualNetworksOperations oper /// /// The name of the resource group. /// - public static IPage List(this IVirtualNetworksOperations operations, string resourceGroupName) + public static Microsoft.Rest.Azure.IPage List(this IVirtualNetworksOperations operations, string resourceGroupName) { - return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list VirtualNetwork returns all Virtual Networks in a resource group + /// Gets all virtual networks in a resource group. /// /// /// The operations group for this extension method. @@ -294,7 +283,7 @@ public static IPage List(this IVirtualNetworksOperations operati /// /// The cancellation token. /// - public static async Task> ListAsync(this IVirtualNetworksOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IVirtualNetworksOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { @@ -303,7 +292,7 @@ public static IPage List(this IVirtualNetworksOperations operati } /// - /// Checks whether a private Ip address is available for use. + /// Checks whether a private IP address is available for use. /// /// /// The operations group for this extension method. @@ -319,11 +308,11 @@ public static IPage List(this IVirtualNetworksOperations operati /// public static IPAddressAvailabilityResult CheckIPAddressAvailability(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string ipAddress = default(string)) { - return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).CheckIPAddressAvailabilityAsync(resourceGroupName, virtualNetworkName, ipAddress), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).CheckIPAddressAvailabilityAsync(resourceGroupName, virtualNetworkName, ipAddress), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Checks whether a private Ip address is available for use. + /// Checks whether a private IP address is available for use. /// /// /// The operations group for this extension method. @@ -340,7 +329,7 @@ public static IPage List(this IVirtualNetworksOperations operati /// /// The cancellation token. /// - public static async Task CheckIPAddressAvailabilityAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string ipAddress = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task CheckIPAddressAvailabilityAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string ipAddress = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CheckIPAddressAvailabilityWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, ipAddress, null, cancellationToken).ConfigureAwait(false)) { @@ -349,7 +338,7 @@ public static IPage List(this IVirtualNetworksOperations operati } /// - /// The list VirtualNetwork returns all Virtual Networks in a subscription + /// Gets all virtual networks in a subscription. /// /// /// The operations group for this extension method. @@ -357,13 +346,13 @@ public static IPage List(this IVirtualNetworksOperations operati /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListAllNext(this IVirtualNetworksOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListAllNext(this IVirtualNetworksOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).ListAllNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).ListAllNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list VirtualNetwork returns all Virtual Networks in a subscription + /// Gets all virtual networks in a subscription. /// /// /// The operations group for this extension method. @@ -374,7 +363,7 @@ public static IPage ListAllNext(this IVirtualNetworksOperations /// /// The cancellation token. /// - public static async Task> ListAllNextAsync(this IVirtualNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllNextAsync(this IVirtualNetworksOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -383,7 +372,7 @@ public static IPage ListAllNext(this IVirtualNetworksOperations } /// - /// The list VirtualNetwork returns all Virtual Networks in a resource group + /// Gets all virtual networks in a resource group. /// /// /// The operations group for this extension method. @@ -391,13 +380,13 @@ public static IPage ListAllNext(this IVirtualNetworksOperations /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this IVirtualNetworksOperations operations, string nextPageLink) + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualNetworksOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list VirtualNetwork returns all Virtual Networks in a resource group + /// Gets all virtual networks in a resource group. /// /// /// The operations group for this extension method. @@ -408,7 +397,7 @@ public static IPage ListNext(this IVirtualNetworksOperations ope /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IVirtualNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this IVirtualNetworksOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Properties/AssemblyInfo.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Properties/AssemblyInfo.cs index 1aa9a2b17aa48..b3a90c320a9aa 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Properties/AssemblyInfo.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Properties/AssemblyInfo.cs @@ -19,8 +19,8 @@ [assembly: AssemblyTitle("Microsoft Azure Network Management Library")] [assembly: AssemblyDescription("Provides Microsoft Azure Network management functions for managing the Microsoft Azure Network service.")] -[assembly: AssemblyVersion("8.1.0.0")] -[assembly: AssemblyFileVersion("8.1.0.0")] +[assembly: AssemblyVersion("9.0.0.0")] +[assembly: AssemblyFileVersion("9.0.0.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/generate.cmd b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/generate.cmd index 55a47519f62a7..cf2f3722077dc 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/generate.cmd +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/generate.cmd @@ -4,7 +4,7 @@ :: @echo off -set autoRestVersion=0.16.0-Nightly20160406 +set autoRestVersion=0.17.0-Nightly20161002 if "%1" == "" ( set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-network/2016-06-01/swagger/network.json" ) else ( diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/project.json b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/project.json index bb4114624d1ce..3fe93a3c4f9cc 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/project.json +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/project.json @@ -1,5 +1,5 @@ { - "version": "8.1.0-preview", + "version": "9.0.0-preview", "description": "Provides management capabilities for Network services.", "authors": [ "Microsoft" ], diff --git a/src/ResourceManagement/Network/Network.Tests/SessionRecords/Networks.Tests.VirtualNetworkTests/VirtualNetworkPeeringTest.json b/src/ResourceManagement/Network/Network.Tests/SessionRecords/Networks.Tests.VirtualNetworkTests/VirtualNetworkPeeringTest.json new file mode 100644 index 0000000000000..aadca267f1802 --- /dev/null +++ b/src/ResourceManagement/Network/Network.Tests/SessionRecords/Networks.Tests.VirtualNetworkTests/VirtualNetworkPeeringTest.json @@ -0,0 +1,1437 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yaz9hcGktdmVyc2lvbj0yMDE1LTExLTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "807260af-5542-4d58-b432-0c3b1ed87c78" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0-preview" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network\",\r\n \"namespace\": \"Microsoft.Network\",\r\n \"authorization\": {\r\n \"applicationId\": \"2cf9eb86-36b5-49dc-86ae-9a63135dfa8c\",\r\n \"roleDefinitionId\": \"13ba9ab4-19f0-4804-adc4-14ece36cc7a1\"\r\n },\r\n \"resourceTypes\": [\r\n {\r\n \"resourceType\": \"virtualNetworks\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"publicIPAddresses\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"networkInterfaces\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"loadBalancers\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"networkSecurityGroups\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"routeTables\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"virtualNetworkGateways\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"None\"\r\n },\r\n {\r\n \"resourceType\": \"localNetworkGateways\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"None\"\r\n },\r\n {\r\n \"resourceType\": \"connections\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"None\"\r\n },\r\n {\r\n \"resourceType\": \"applicationGateways\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"None\"\r\n },\r\n {\r\n \"resourceType\": \"locations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/operations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/operationResults\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/CheckDnsNameAvailability\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/usages\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"operations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"dnszones\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-04-01\",\r\n \"2015-05-04-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"dnsOperationResults\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-04-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"dnsOperationStatuses\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-04-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"dnszones/A\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-04-01\",\r\n \"2015-05-04-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"dnszones/AAAA\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-04-01\",\r\n \"2015-05-04-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"dnszones/CNAME\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-04-01\",\r\n \"2015-05-04-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"dnszones/PTR\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-04-01\",\r\n \"2015-05-04-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"dnszones/MX\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-04-01\",\r\n \"2015-05-04-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"dnszones/TXT\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-04-01\",\r\n \"2015-05-04-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"dnszones/SRV\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-04-01\",\r\n \"2015-05-04-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"trafficmanagerprofiles\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2015-11-01\",\r\n \"2015-04-28-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"checkTrafficManagerNameAvailability\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2015-11-01\",\r\n \"2015-04-28-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"expressRouteCircuits\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"None\"\r\n },\r\n {\r\n \"resourceType\": \"expressRouteServiceProviders\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"networkWatchers\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"West India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK North\",\r\n \"UK South 2\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n }\r\n ],\r\n \"registrationState\": \"Registered\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:55:16 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14995" + ], + "x-ms-request-id": [ + "44de402c-868b-42ab-8ce3-42fa29bb6b9c" + ], + "x-ms-correlation-request-id": [ + "44de402c-868b-42ab-8ce3-42fa29bb6b9c" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225516Z:44de402c-868b-42ab-8ce3-42fa29bb6b9c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourcegroups/csmrg4533?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlZ3JvdXBzL2NzbXJnNDUzMz9hcGktdmVyc2lvbj0yMDE1LTExLTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"West US\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "29" + ], + "x-ms-client-request-id": [ + "1f07c22b-f593-4226-a99a-1f3c73548fb3" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0-preview" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533\",\r\n \"name\": \"csmrg4533\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "171" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:55:17 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "1f433485-a3b5-479d-95d6-e9d8b3c68daa" + ], + "x-ms-correlation-request-id": [ + "1f433485-a3b5-479d-95d6-e9d8b3c68daa" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225517Z:1f433485-a3b5-479d-95d6-e9d8b3c68daa" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": [\r\n \"10.1.1.1\",\r\n \"10.1.2.4\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"properties\": {\r\n \"addressPrefix\": \"10.0.1.0/24\"\r\n },\r\n \"name\": \"azsmnet6700\"\r\n },\r\n {\r\n \"properties\": {\r\n \"addressPrefix\": \"10.0.2.0/24\"\r\n },\r\n \"name\": \"azsmnet7820\"\r\n }\r\n ]\r\n },\r\n \"location\": \"West US\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "530" + ], + "x-ms-client-request-id": [ + "8eaa8106-8846-4c80-80b6-74b0104d8516" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"azsmnet5619\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619\",\r\n \"etag\": \"W/\\\"b664c09d-de0b-45e6-913a-6367a710e92a\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"resourceGuid\": \"820b8dc6-b1fe-4b94-a663-a3c7daf3bd39\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": [\r\n \"10.1.1.1\",\r\n \"10.1.2.4\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\": \"azsmnet6700\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/subnets/azsmnet6700\",\r\n \"etag\": \"W/\\\"b664c09d-de0b-45e6-913a-6367a710e92a\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"addressPrefix\": \"10.0.1.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n },\r\n {\r\n \"name\": \"azsmnet7820\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/subnets/azsmnet7820\",\r\n \"etag\": \"W/\\\"b664c09d-de0b-45e6-913a-6367a710e92a\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"addressPrefix\": \"10.0.2.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n }\r\n ],\r\n \"virtualNetworkPeerings\": []\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "1561" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:56:12 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "10" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "e9c55f19-519e-4c28-a7c2-38d4c48caf56" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/e9c55f19-519e-4c28-a7c2-38d4c48caf56?api-version=2016-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1197" + ], + "x-ms-correlation-request-id": [ + "8d711bdd-73e2-4959-97a3-5ed64f77dd6f" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225612Z:8d711bdd-73e2-4959-97a3-5ed64f77dd6f" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/e9c55f19-519e-4c28-a7c2-38d4c48caf56?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvbnMvZTljNTVmMTktNTE5ZS00YzI4LWE3YzItMzhkNGM0OGNhZjU2P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"status\": \"Succeeded\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:56:42 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "d9669ead-5286-48f7-a4f0-82ce6396bdf3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14976" + ], + "x-ms-correlation-request-id": [ + "98324149-96f3-4c48-b015-4da7ce14bad6" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225643Z:98324149-96f3-4c48-b015-4da7ce14bad6" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"azsmnet5619\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619\",\r\n \"etag\": \"W/\\\"5b9bfd45-667a-4c89-acb7-80d5ac359722\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": \"820b8dc6-b1fe-4b94-a663-a3c7daf3bd39\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": [\r\n \"10.1.1.1\",\r\n \"10.1.2.4\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\": \"azsmnet6700\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/subnets/azsmnet6700\",\r\n \"etag\": \"W/\\\"5b9bfd45-667a-4c89-acb7-80d5ac359722\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.1.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n },\r\n {\r\n \"name\": \"azsmnet7820\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/subnets/azsmnet7820\",\r\n \"etag\": \"W/\\\"5b9bfd45-667a-4c89-acb7-80d5ac359722\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.2.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n }\r\n ],\r\n \"virtualNetworkPeerings\": []\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:56:42 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "W/\"5b9bfd45-667a-4c89-acb7-80d5ac359722\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "2dfc11c5-2c3c-40ef-ba9c-daacd3c957e5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14975" + ], + "x-ms-correlation-request-id": [ + "45e69c8b-6673-44ce-bfc4-48c70d672a2f" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225643Z:45e69c8b-6673-44ce-bfc4-48c70d672a2f" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "2a782036-f45a-4ba6-8e37-42d205ddbbd6" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"azsmnet5619\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619\",\r\n \"etag\": \"W/\\\"5b9bfd45-667a-4c89-acb7-80d5ac359722\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": \"820b8dc6-b1fe-4b94-a663-a3c7daf3bd39\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": [\r\n \"10.1.1.1\",\r\n \"10.1.2.4\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\": \"azsmnet6700\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/subnets/azsmnet6700\",\r\n \"etag\": \"W/\\\"5b9bfd45-667a-4c89-acb7-80d5ac359722\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.1.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n },\r\n {\r\n \"name\": \"azsmnet7820\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/subnets/azsmnet7820\",\r\n \"etag\": \"W/\\\"5b9bfd45-667a-4c89-acb7-80d5ac359722\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.2.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n }\r\n ],\r\n \"virtualNetworkPeerings\": []\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:56:42 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "W/\"5b9bfd45-667a-4c89-acb7-80d5ac359722\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "0e3823c6-f1bd-4726-853e-08d00678deb7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14974" + ], + "x-ms-correlation-request-id": [ + "e976c9ed-1ce7-4b0b-bf7e-8da84ad35500" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225643Z:e976c9ed-1ce7-4b0b-bf7e-8da84ad35500" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "0c884c10-f10d-4065-9671-8527bfe88654" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"azsmnet5619\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619\",\r\n \"etag\": \"W/\\\"9bf560dd-fd1d-493a-b093-084fc40d256f\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": \"820b8dc6-b1fe-4b94-a663-a3c7daf3bd39\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": [\r\n \"10.1.1.1\",\r\n \"10.1.2.4\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\": \"azsmnet6700\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/subnets/azsmnet6700\",\r\n \"etag\": \"W/\\\"9bf560dd-fd1d-493a-b093-084fc40d256f\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.1.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n },\r\n {\r\n \"name\": \"azsmnet7820\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/subnets/azsmnet7820\",\r\n \"etag\": \"W/\\\"9bf560dd-fd1d-493a-b093-084fc40d256f\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.2.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n }\r\n ],\r\n \"virtualNetworkPeerings\": [\r\n {\r\n \"name\": \"peer1\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings/peer1\",\r\n \"etag\": \"W/\\\"9bf560dd-fd1d-493a-b093-084fc40d256f\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"peeringState\": \"Initiated\",\r\n \"remoteVirtualNetwork\": {\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476\"\r\n },\r\n \"allowVirtualNetworkAccess\": true,\r\n \"allowForwardedTraffic\": true,\r\n \"allowGatewayTransit\": false,\r\n \"useRemoteGateways\": false,\r\n \"remoteAddressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.1.0.0/16\"\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:57:59 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "W/\"9bf560dd-fd1d-493a-b093-084fc40d256f\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "f24c3552-92da-4b43-84e3-f2a4dfaf342c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14967" + ], + "x-ms-correlation-request-id": [ + "d856371e-8f48-4f59-b89d-fe37d270d119" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225800Z:d856371e-8f48-4f59-b89d-fe37d270d119" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "139c04a6-a375-48c3-9aa9-d7176fdef242" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"azsmnet5619\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619\",\r\n \"etag\": \"W/\\\"7541f070-fc74-4917-8d2c-9a1a026df955\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": \"820b8dc6-b1fe-4b94-a663-a3c7daf3bd39\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": [\r\n \"10.1.1.1\",\r\n \"10.1.2.4\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\": \"azsmnet6700\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/subnets/azsmnet6700\",\r\n \"etag\": \"W/\\\"7541f070-fc74-4917-8d2c-9a1a026df955\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.1.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n },\r\n {\r\n \"name\": \"azsmnet7820\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/subnets/azsmnet7820\",\r\n \"etag\": \"W/\\\"7541f070-fc74-4917-8d2c-9a1a026df955\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.2.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n }\r\n ],\r\n \"virtualNetworkPeerings\": []\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:58:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "W/\"7541f070-fc74-4917-8d2c-9a1a026df955\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "a24ab917-9f2e-4ae3-ab66-ce6402f53027" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14964" + ], + "x-ms-correlation-request-id": [ + "b56ce094-acb3-4bff-8582-e4b2d5cf60ae" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225845Z:b56ce094-acb3-4bff-8582-e4b2d5cf60ae" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQxNDc2P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.1.0.0/16\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"properties\": {\r\n \"addressPrefix\": \"10.1.1.0/24\"\r\n },\r\n \"name\": \"azsmnet6700\"\r\n }\r\n ]\r\n },\r\n \"location\": \"West US\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "298" + ], + "x-ms-client-request-id": [ + "221fb0fa-a90f-4cca-9e19-5f6f068c224e" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"azsmnet1476\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476\",\r\n \"etag\": \"W/\\\"38471c74-ad10-4107-a6cf-10482a466c9e\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"resourceGuid\": \"9c8b9358-5e65-43ae-aa0d-256cf14c3b9b\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.1.0.0/16\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\": \"azsmnet6700\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476/subnets/azsmnet6700\",\r\n \"etag\": \"W/\\\"38471c74-ad10-4107-a6cf-10482a466c9e\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"addressPrefix\": \"10.1.1.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n }\r\n ],\r\n \"virtualNetworkPeerings\": []\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "1018" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:56:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "10" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "53c9e2d1-865d-4bc5-9cab-925bf0afb411" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/53c9e2d1-865d-4bc5-9cab-925bf0afb411?api-version=2016-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "64410e00-46ab-4a5c-8249-e88f8d99fc7b" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225645Z:64410e00-46ab-4a5c-8249-e88f8d99fc7b" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/53c9e2d1-865d-4bc5-9cab-925bf0afb411?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvbnMvNTNjOWUyZDEtODY1ZC00YmM1LTljYWItOTI1YmYwYWZiNDExP2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"status\": \"Succeeded\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:57:15 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "8cf02e1a-833c-475f-be2c-adbaf3cdabd0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14973" + ], + "x-ms-correlation-request-id": [ + "606bbea5-23c9-424c-87c6-6ba87a6e9654" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225715Z:606bbea5-23c9-424c-87c6-6ba87a6e9654" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQxNDc2P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"azsmnet1476\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476\",\r\n \"etag\": \"W/\\\"eca180e2-af78-4f85-8d52-dc8e7faa9168\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": \"9c8b9358-5e65-43ae-aa0d-256cf14c3b9b\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.1.0.0/16\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\": \"azsmnet6700\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476/subnets/azsmnet6700\",\r\n \"etag\": \"W/\\\"eca180e2-af78-4f85-8d52-dc8e7faa9168\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.1.1.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n }\r\n ],\r\n \"virtualNetworkPeerings\": []\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:57:15 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "W/\"eca180e2-af78-4f85-8d52-dc8e7faa9168\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "b942aa40-3843-4f9c-a47e-533aed1cb432" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14972" + ], + "x-ms-correlation-request-id": [ + "a5f80fec-f4c3-4251-b4da-82d68e982e24" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225715Z:a5f80fec-f4c3-4251-b4da-82d68e982e24" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings/peer1?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5L3ZpcnR1YWxOZXR3b3JrUGVlcmluZ3MvcGVlcjE/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"allowForwardedTraffic\": true,\r\n \"remoteVirtualNetwork\": {\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476\"\r\n }\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "250" + ], + "x-ms-client-request-id": [ + "15ab3afd-d2ff-4d3b-8781-c33c453cd468" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"peer1\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings/peer1\",\r\n \"etag\": \"W/\\\"239a5f5b-dc36-4126-b808-664d6a3e4352\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"peeringState\": \"Initiated\",\r\n \"remoteVirtualNetwork\": {\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476\"\r\n },\r\n \"allowVirtualNetworkAccess\": true,\r\n \"allowForwardedTraffic\": true,\r\n \"allowGatewayTransit\": false,\r\n \"useRemoteGateways\": false,\r\n \"remoteAddressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.1.0.0/16\"\r\n ]\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "778" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:57:18 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "10" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "abbc845f-7549-4105-9ab5-ed3270f676c5" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/abbc845f-7549-4105-9ab5-ed3270f676c5?api-version=2016-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1195" + ], + "x-ms-correlation-request-id": [ + "97553415-3325-4bd3-bb54-1aee4915d2ef" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225718Z:97553415-3325-4bd3-bb54-1aee4915d2ef" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/abbc845f-7549-4105-9ab5-ed3270f676c5?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvbnMvYWJiYzg0NWYtNzU0OS00MTA1LTlhYjUtZWQzMjcwZjY3NmM1P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"status\": \"Succeeded\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:57:48 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "e343e5f2-af4f-46cf-b418-36ee29e3c441" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14971" + ], + "x-ms-correlation-request-id": [ + "cb9fa8fb-e9c6-4205-a6fb-0c4355567ce9" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225749Z:cb9fa8fb-e9c6-4205-a6fb-0c4355567ce9" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings/peer1?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5L3ZpcnR1YWxOZXR3b3JrUGVlcmluZ3MvcGVlcjE/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"peer1\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings/peer1\",\r\n \"etag\": \"W/\\\"9bf560dd-fd1d-493a-b093-084fc40d256f\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"peeringState\": \"Initiated\",\r\n \"remoteVirtualNetwork\": {\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476\"\r\n },\r\n \"allowVirtualNetworkAccess\": true,\r\n \"allowForwardedTraffic\": true,\r\n \"allowGatewayTransit\": false,\r\n \"useRemoteGateways\": false,\r\n \"remoteAddressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.1.0.0/16\"\r\n ]\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:57:48 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "W/\"9bf560dd-fd1d-493a-b093-084fc40d256f\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "1a14205f-af53-4905-8555-4ddb9c5e9d95" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14970" + ], + "x-ms-correlation-request-id": [ + "1f18e11f-6c76-4e5d-893e-9b00ca65c0be" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225749Z:1f18e11f-6c76-4e5d-893e-9b00ca65c0be" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings/peer1?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5L3ZpcnR1YWxOZXR3b3JrUGVlcmluZ3MvcGVlcjE/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "89273bc5-d37e-43e1-9222-661033682cfd" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"peer1\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings/peer1\",\r\n \"etag\": \"W/\\\"9bf560dd-fd1d-493a-b093-084fc40d256f\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"peeringState\": \"Initiated\",\r\n \"remoteVirtualNetwork\": {\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476\"\r\n },\r\n \"allowVirtualNetworkAccess\": true,\r\n \"allowForwardedTraffic\": true,\r\n \"allowGatewayTransit\": false,\r\n \"useRemoteGateways\": false,\r\n \"remoteAddressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.1.0.0/16\"\r\n ]\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:57:53 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "W/\"9bf560dd-fd1d-493a-b093-084fc40d256f\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "1761348f-7721-476d-b656-c59a7c1cf1ad" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14969" + ], + "x-ms-correlation-request-id": [ + "96e58931-a92c-471a-9c5f-694b7a75be31" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225754Z:96e58931-a92c-471a-9c5f-694b7a75be31" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5L3ZpcnR1YWxOZXR3b3JrUGVlcmluZ3M/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "10748ab2-8a8c-475b-bc9b-b2864e83a3da" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"name\": \"peer1\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings/peer1\",\r\n \"etag\": \"W/\\\"9bf560dd-fd1d-493a-b093-084fc40d256f\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"peeringState\": \"Initiated\",\r\n \"remoteVirtualNetwork\": {\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476\"\r\n },\r\n \"allowVirtualNetworkAccess\": true,\r\n \"allowForwardedTraffic\": true,\r\n \"allowGatewayTransit\": false,\r\n \"useRemoteGateways\": false,\r\n \"remoteAddressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.1.0.0/16\"\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:57:55 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "469971fa-e0a2-4cc6-858b-dee15f712ab5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14968" + ], + "x-ms-correlation-request-id": [ + "62efb437-baa8-41cc-bc22-5cb32e70a620" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225756Z:62efb437-baa8-41cc-bc22-5cb32e70a620" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5L3ZpcnR1YWxOZXR3b3JrUGVlcmluZ3M/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7551f33d-3c6f-4ddf-aaf9-647f2368c198" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"value\": []\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:58:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "2e75296d-8100-463c-a2aa-381300abbee2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14965" + ], + "x-ms-correlation-request-id": [ + "a8b6adc3-36fa-4e48-8f6a-05cfe3870eae" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225844Z:a8b6adc3-36fa-4e48-8f6a-05cfe3870eae" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings/peer1?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5L3ZpcnR1YWxOZXR3b3JrUGVlcmluZ3MvcGVlcjE/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7c298764-3ece-42d8-9aa3-e4f0ce789bfd" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:58:14 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operationResults/72f70e8c-36a1-4482-87ea-8576fcf7f823?api-version=2016-09-01" + ], + "Retry-After": [ + "10" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "72f70e8c-36a1-4482-87ea-8576fcf7f823" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/72f70e8c-36a1-4482-87ea-8576fcf7f823?api-version=2016-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1194" + ], + "x-ms-correlation-request-id": [ + "e3b79ea6-0d28-42c8-a64f-5dd40dd17307" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225814Z:e3b79ea6-0d28-42c8-a64f-5dd40dd17307" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/72f70e8c-36a1-4482-87ea-8576fcf7f823?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvbnMvNzJmNzBlOGMtMzZhMS00NDgyLTg3ZWEtODU3NmZjZjdmODIzP2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"status\": \"Succeeded\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:58:43 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "613acbfa-9524-4860-a70f-40d320abb4b6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14966" + ], + "x-ms-correlation-request-id": [ + "4639577d-f112-429d-8ffc-90ce104cc3dd" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225844Z:4639577d-f112-429d-8ffc-90ce104cc3dd" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "205a243e-3997-4072-932f-05c563e703ba" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:58:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operationResults/bf6e70fe-9654-4caa-ab74-9a2a50cf683c?api-version=2016-09-01" + ], + "Retry-After": [ + "10" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "bf6e70fe-9654-4caa-ab74-9a2a50cf683c" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/bf6e70fe-9654-4caa-ab74-9a2a50cf683c?api-version=2016-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1193" + ], + "x-ms-correlation-request-id": [ + "e9a541d3-7372-4eb9-938e-8e5654557f95" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225845Z:e9a541d3-7372-4eb9-938e-8e5654557f95" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/bf6e70fe-9654-4caa-ab74-9a2a50cf683c?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvbnMvYmY2ZTcwZmUtOTY1NC00Y2FhLWFiNzQtOWEyYTUwY2Y2ODNjP2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"status\": \"Succeeded\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:59:15 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "eec15753-44de-464d-b1f2-9c11ee4ad296" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14963" + ], + "x-ms-correlation-request-id": [ + "8e2e2b3a-10bc-4767-a4f4-0a10d024c593" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225915Z:8e2e2b3a-10bc-4767-a4f4-0a10d024c593" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQxNDc2P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "9284ef82-1c07-4e04-a558-044f1dec9cc3" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:59:15 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operationResults/1e1eff12-10ca-460f-9ff5-098c619eae9b?api-version=2016-09-01" + ], + "Retry-After": [ + "10" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "1e1eff12-10ca-460f-9ff5-098c619eae9b" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/1e1eff12-10ca-460f-9ff5-098c619eae9b?api-version=2016-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1192" + ], + "x-ms-correlation-request-id": [ + "5a6825cd-8d0b-4cc8-b458-81969b85abf0" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225915Z:5a6825cd-8d0b-4cc8-b458-81969b85abf0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/1e1eff12-10ca-460f-9ff5-098c619eae9b?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvbnMvMWUxZWZmMTItMTBjYS00NjBmLTlmZjUtMDk4YzYxOWVhZTliP2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"status\": \"Succeeded\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:59:45 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "4a458d8a-bff6-4d13-8b2c-301533616440" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14962" + ], + "x-ms-correlation-request-id": [ + "68e5088f-d71b-4352-b3b8-5f4126fa3c40" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225946Z:68e5088f-d71b-4352-b3b8-5f4126fa3c40" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "VirtualNetworkPeeringTest": [ + "csmrg4533", + "azsmnet5619", + "azsmnet1476", + "azsmnet6700", + "azsmnet7820" + ] + }, + "Variables": { + "SubscriptionId": "9532a63e-f2eb-4649-bb23-5ed01077ce80" + } +} \ No newline at end of file diff --git a/src/ResourceManagement/Network/Network.Tests/Tests/ApplicationGatewayTests.cs b/src/ResourceManagement/Network/Network.Tests/Tests/ApplicationGatewayTests.cs index 4f219c9759ec6..c7cd7052472ad 100644 --- a/src/ResourceManagement/Network/Network.Tests/Tests/ApplicationGatewayTests.cs +++ b/src/ResourceManagement/Network/Network.Tests/Tests/ApplicationGatewayTests.cs @@ -96,7 +96,7 @@ private ApplicationGateway CreateApplicationGateway(string location, Subnet subn var appGw = new ApplicationGateway() { Location = location, - SslPolicy = new ApplicationGatewaySslPolicy() + SSLPolicy = new ApplicationGatewaySslPolicy() { DisabledSslProtocols = new List() { @@ -232,7 +232,7 @@ private ApplicationGateway CreateApplicationGateway(string location, Subnet subn Id = GetChildAppGwResourceId(subscriptionId, resourceGroupName, appGwName, "frontendIPConfigurations", frontendIPConfigName) }, - SslCertificate = null, + SSLCertificate = null, Protocol = ApplicationGatewayProtocol.Http }, new ApplicationGatewayHttpListener() @@ -248,7 +248,7 @@ private ApplicationGateway CreateApplicationGateway(string location, Subnet subn Id = GetChildAppGwResourceId(subscriptionId, resourceGroupName, appGwName, "frontendIPConfigurations", frontendIPConfigName) }, - SslCertificate = null, + SSLCertificate = null, Protocol = ApplicationGatewayProtocol.Http }, //new ApplicationGatewayHttpListener() @@ -399,7 +399,7 @@ private void CompareApplicationGateway(ApplicationGateway gw1, ApplicationGatewa Assert.Equal(gw1.BackendHttpSettingsCollection.Count, gw2.BackendHttpSettingsCollection.Count); Assert.Equal(gw1.HttpListeners.Count, gw2.HttpListeners.Count); Assert.Equal(gw1.RequestRoutingRules.Count, gw2.RequestRoutingRules.Count); - Assert.Equal(gw1.SslPolicy.DisabledSslProtocols.Count, gw2.SslPolicy.DisabledSslProtocols.Count); + Assert.Equal(gw1.SSLPolicy.DisabledSslProtocols.Count, gw2.SSLPolicy.DisabledSslProtocols.Count); Assert.Equal(gw1.AuthenticationCertificates.Count, gw2.AuthenticationCertificates.Count); Assert.Equal(gw1.WebApplicationFirewallConfiguration.Enabled, gw2.WebApplicationFirewallConfiguration.Enabled); Assert.Equal(gw1.WebApplicationFirewallConfiguration.FirewallMode, gw2.WebApplicationFirewallConfiguration.FirewallMode); diff --git a/src/ResourceManagement/Network/Network.Tests/Tests/VirtualNetworkTests.cs b/src/ResourceManagement/Network/Network.Tests/Tests/VirtualNetworkTests.cs index 7eee38e548f37..a4c33a71bc3a5 100644 --- a/src/ResourceManagement/Network/Network.Tests/Tests/VirtualNetworkTests.cs +++ b/src/ResourceManagement/Network/Network.Tests/Tests/VirtualNetworkTests.cs @@ -214,5 +214,160 @@ public void VirtualNetworkCheckIpAddressAvailabilityTest() networkManagementClient.VirtualNetworks.Delete(resourceGroupName, vnetName); } } + + [Fact] + public void VirtualNetworkPeeringTest() + { + var handler1 = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; + var handler2 = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; + + using (MockContext context = MockContext.Start(this.GetType().FullName)) + { + + var resourcesClient = ResourcesManagementTestUtilities.GetResourceManagementClientWithHandler(context, handler1); + var networkManagementClient = NetworkManagementTestUtilities.GetNetworkManagementClientWithHandler(context, handler2); + + var location = NetworkManagementTestUtilities.GetResourceLocation(resourcesClient, "Microsoft.Network/virtualNetworks"); + + string resourceGroupName = TestUtilities.GenerateName("csmrg"); + resourcesClient.ResourceGroups.CreateOrUpdate(resourceGroupName, + new ResourceGroup + { + Location = location + }); + + string vnet1Name = TestUtilities.GenerateName(); + string vnet2Name = TestUtilities.GenerateName(); + string subnet1Name = TestUtilities.GenerateName(); + string subnet2Name = TestUtilities.GenerateName(); + + var vnet = new VirtualNetwork() + { + Location = location, + + AddressSpace = new AddressSpace() + { + AddressPrefixes = new List() + { + "10.0.0.0/16", + } + }, + DhcpOptions = new DhcpOptions() + { + DnsServers = new List() + { + "10.1.1.1", + "10.1.2.4" + } + }, + Subnets = new List() + { + new Subnet() + { + Name = subnet1Name, + AddressPrefix = "10.0.1.0/24", + }, + new Subnet() + { + Name = subnet2Name, + AddressPrefix = "10.0.2.0/24", + } + } + }; + + // Put Vnet + var putVnetResponse = networkManagementClient.VirtualNetworks.CreateOrUpdate(resourceGroupName, vnet1Name, vnet); + Assert.Equal("Succeeded", putVnetResponse.ProvisioningState); + + // Get Vnet + var getVnetResponse = networkManagementClient.VirtualNetworks.Get(resourceGroupName, vnet1Name); + Assert.Equal(vnet1Name, getVnetResponse.Name); + Assert.NotNull(getVnetResponse.ResourceGuid); + Assert.Equal("Succeeded", getVnetResponse.ProvisioningState); + + // Create vnet2 + var vnet2 = new VirtualNetwork() + { + Location = location, + + AddressSpace = new AddressSpace() + { + AddressPrefixes = new List() + { + "10.1.0.0/16", + } + }, + Subnets = new List() + { + new Subnet() + { + Name = subnet1Name, + AddressPrefix = "10.1.1.0/24", + } + } + }; + + // Put Vnet2 + var putVnet2 = networkManagementClient.VirtualNetworks.CreateOrUpdate(resourceGroupName, vnet2Name, vnet2); + Assert.Equal("Succeeded", putVnet2.ProvisioningState); + + // Create peering object + var peering = new VirtualNetworkPeering() + { + AllowForwardedTraffic = true, + RemoteVirtualNetwork = new Microsoft.Azure.Management.Network.Models.SubResource + { + Id = putVnet2.Id + } + }; + + // Create Peering + networkManagementClient.VirtualNetworkPeerings.CreateOrUpdate(resourceGroupName, vnet1Name, "peer1", peering); + + // Get Peering + var getPeer = networkManagementClient.VirtualNetworkPeerings.Get(resourceGroupName, vnet1Name, "peer1"); + Assert.Equal("peer1", getPeer.Name); + Assert.Equal(true, getPeer.AllowForwardedTraffic); + Assert.Equal(true, getPeer.AllowVirtualNetworkAccess); + Assert.Equal(false, getPeer.AllowGatewayTransit); + Assert.NotNull(getPeer.RemoteVirtualNetwork); + Assert.Equal(putVnet2.Id, getPeer.RemoteVirtualNetwork.Id); + + // List Peering + var listPeer = networkManagementClient.VirtualNetworkPeerings.List(resourceGroupName, vnet1Name).ToList(); + Assert.Equal(1, listPeer.Count); + Assert.Equal("peer1", listPeer[0].Name); + Assert.Equal(true, listPeer[0].AllowForwardedTraffic); + Assert.Equal(true, listPeer[0].AllowVirtualNetworkAccess); + Assert.Equal(false, listPeer[0].AllowGatewayTransit); + Assert.NotNull(listPeer[0].RemoteVirtualNetwork); + Assert.Equal(putVnet2.Id, listPeer[0].RemoteVirtualNetwork.Id); + + // Get peering from GET vnet + var peeringVnet = networkManagementClient.VirtualNetworks.Get(resourceGroupName, vnet1Name); + Assert.Equal(vnet1Name, peeringVnet.Name); + Assert.Equal(1, peeringVnet.VirtualNetworkPeerings.Count()); + Assert.Equal("peer1", peeringVnet.VirtualNetworkPeerings[0].Name); + Assert.Equal(true, peeringVnet.VirtualNetworkPeerings[0].AllowForwardedTraffic); + Assert.Equal(true, peeringVnet.VirtualNetworkPeerings[0].AllowVirtualNetworkAccess); + Assert.Equal(false, peeringVnet.VirtualNetworkPeerings[0].AllowGatewayTransit); + Assert.NotNull(peeringVnet.VirtualNetworkPeerings[0].RemoteVirtualNetwork); + Assert.Equal(putVnet2.Id, peeringVnet.VirtualNetworkPeerings[0].RemoteVirtualNetwork.Id); + + // Delete Peering + networkManagementClient.VirtualNetworkPeerings.Delete(resourceGroupName, vnet1Name, "peer1"); + + listPeer = networkManagementClient.VirtualNetworkPeerings.List(resourceGroupName, vnet1Name).ToList(); + Assert.Equal(0, listPeer.Count); + + peeringVnet = networkManagementClient.VirtualNetworks.Get(resourceGroupName, vnet1Name); + Assert.Equal(vnet1Name, peeringVnet.Name); + Assert.Equal(0, peeringVnet.VirtualNetworkPeerings.Count()); + + // Delete Vnets + networkManagementClient.VirtualNetworks.Delete(resourceGroupName, vnet1Name); + networkManagementClient.VirtualNetworks.Delete(resourceGroupName, vnet2Name); + } + } } } \ No newline at end of file diff --git a/src/ResourceManagement/Network/Network.sln b/src/ResourceManagement/Network/Network.sln index beedfbed0a352..f22ca8c3ad52a 100644 --- a/src/ResourceManagement/Network/Network.sln +++ b/src/ResourceManagement/Network/Network.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Management.Network", "Microsoft.Azure.Management.Network\Microsoft.Azure.Management.Network.xproj", "{4F22B186-DEB4-4B95-BA58-0187F0E32993}" EndProject @@ -11,6 +11,12 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "HttpRecorder", "..\..\TestF EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestFramework", "..\..\TestFramework\Microsoft.Rest.ClientRuntime.Azure.TestFramework\TestFramework.xproj", "{C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}" EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Rest.ClientRuntime", "..\..\ClientRuntime\Microsoft.Rest.ClientRuntime\Microsoft.Rest.ClientRuntime.xproj", "{EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Rest.ClientRuntime.Azure", "..\..\ClientRuntime\Microsoft.Rest.ClientRuntime.Azure\Microsoft.Rest.ClientRuntime.Azure.xproj", "{D5296EAB-C13E-4A88-9532-BD0677D18EC9}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Rest.ClientRuntime.Azure.Authentication", "..\..\ClientRuntime\Microsoft.Rest.ClientRuntime.Azure.Authentication\Microsoft.Rest.ClientRuntime.Azure.Authentication.xproj", "{6319205D-BBFC-4150-BEAE-31B1C9B911DD}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -33,6 +39,18 @@ Global {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Debug|Any CPU.Build.0 = Debug|Any CPU {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Release|Any CPU.ActiveCfg = Release|Any CPU {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Release|Any CPU.Build.0 = Release|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Release|Any CPU.Build.0 = Release|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Release|Any CPU.Build.0 = Release|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From f3dc05ae32f423641005953161ca5577fe7a43f0 Mon Sep 17 00:00:00 2001 From: Deepak Rajendran Date: Mon, 7 Nov 2016 17:07:04 -0800 Subject: [PATCH 2/6] fix compute failure --- .../Compute/Compute.Tests/ScenarioTests/VMTestBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ResourceManagement/Compute/Compute.Tests/ScenarioTests/VMTestBase.cs b/src/ResourceManagement/Compute/Compute.Tests/ScenarioTests/VMTestBase.cs index 8b4ba4655a5e2..2924c6266a41d 100644 --- a/src/ResourceManagement/Compute/Compute.Tests/ScenarioTests/VMTestBase.cs +++ b/src/ResourceManagement/Compute/Compute.Tests/ScenarioTests/VMTestBase.cs @@ -532,7 +532,7 @@ protected ApplicationGateway CreateApplicationGateway(string rgName, Subnet subn { Id = GetChildAppGwResourceId(m_subId, rgName, gatewayName, "frontendIPConfigurations", frontendIPConfigName) }, - SslCertificate = null, + SSLCertificate = null, Protocol = ApplicationGatewayProtocol.Http }; From a85dc2dc0a02394fb7bb9a36a2ce4969003e2e3e Mon Sep 17 00:00:00 2001 From: Deepak Rajendran Date: Mon, 7 Nov 2016 18:24:12 -0800 Subject: [PATCH 3/6] fix application gateway --- .../Compute.Tests/ScenarioTests/VMTestBase.cs | 2 +- .../Generated/Models/ApplicationGateway.cs | 18 +++++++++--------- .../Models/ApplicationGatewayHttpListener.cs | 10 +++++----- .../Tests/ApplicationGatewayTests.cs | 8 ++++---- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/ResourceManagement/Compute/Compute.Tests/ScenarioTests/VMTestBase.cs b/src/ResourceManagement/Compute/Compute.Tests/ScenarioTests/VMTestBase.cs index 2924c6266a41d..8b4ba4655a5e2 100644 --- a/src/ResourceManagement/Compute/Compute.Tests/ScenarioTests/VMTestBase.cs +++ b/src/ResourceManagement/Compute/Compute.Tests/ScenarioTests/VMTestBase.cs @@ -532,7 +532,7 @@ protected ApplicationGateway CreateApplicationGateway(string rgName, Subnet subn { Id = GetChildAppGwResourceId(m_subId, rgName, gatewayName, "frontendIPConfigurations", frontendIPConfigName) }, - SSLCertificate = null, + SslCertificate = null, Protocol = ApplicationGatewayProtocol.Http }; diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGateway.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGateway.cs index 15e11956df6c6..409753665fc41 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGateway.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGateway.cs @@ -30,7 +30,7 @@ public ApplicationGateway() { } /// Resource location. /// Resource tags. /// SKU of the application gateway resource. - /// SSL policy of the application gateway + /// SSL policy of the application gateway /// resource. /// Operational state of the /// application gateway resource. Possible values are: 'Stopped', @@ -40,7 +40,7 @@ public ApplicationGateway() { } /// gateway resource. /// Authentication /// certificates of the application gateway resource. - /// SSL certificates of the application + /// SSL certificates of the application /// gateway resource. /// Frontend IP addresses of /// the application gateway resource. @@ -67,15 +67,15 @@ public ApplicationGateway() { } /// 'Deleting', and 'Failed'. /// A unique read-only string that changes whenever /// the resource is updated. - public ApplicationGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ApplicationGatewaySku sku = default(ApplicationGatewaySku), ApplicationGatewaySslPolicy sSLPolicy = default(ApplicationGatewaySslPolicy), string operationalState = default(string), System.Collections.Generic.IList gatewayIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList authenticationCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList sSLCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList frontendIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList frontendPorts = default(System.Collections.Generic.IList), System.Collections.Generic.IList probes = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendHttpSettingsCollection = default(System.Collections.Generic.IList), System.Collections.Generic.IList httpListeners = default(System.Collections.Generic.IList), System.Collections.Generic.IList urlPathMaps = default(System.Collections.Generic.IList), System.Collections.Generic.IList requestRoutingRules = default(System.Collections.Generic.IList), ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration = default(ApplicationGatewayWebApplicationFirewallConfiguration), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + public ApplicationGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ApplicationGatewaySku sku = default(ApplicationGatewaySku), ApplicationGatewaySslPolicy sslPolicy = default(ApplicationGatewaySslPolicy), string operationalState = default(string), System.Collections.Generic.IList gatewayIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList authenticationCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList sslCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList frontendIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList frontendPorts = default(System.Collections.Generic.IList), System.Collections.Generic.IList probes = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendHttpSettingsCollection = default(System.Collections.Generic.IList), System.Collections.Generic.IList httpListeners = default(System.Collections.Generic.IList), System.Collections.Generic.IList urlPathMaps = default(System.Collections.Generic.IList), System.Collections.Generic.IList requestRoutingRules = default(System.Collections.Generic.IList), ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration = default(ApplicationGatewayWebApplicationFirewallConfiguration), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { Sku = sku; - SSLPolicy = sSLPolicy; + SslPolicy = sslPolicy; OperationalState = operationalState; GatewayIPConfigurations = gatewayIPConfigurations; AuthenticationCertificates = authenticationCertificates; - SSLCertificates = sSLCertificates; + SslCertificates = sslCertificates; FrontendIPConfigurations = frontendIPConfigurations; FrontendPorts = frontendPorts; Probes = probes; @@ -99,8 +99,8 @@ public ApplicationGateway() { } /// /// Gets or sets SSL policy of the application gateway resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.SSLPolicy")] - public ApplicationGatewaySslPolicy SSLPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sslPolicy")] + public ApplicationGatewaySslPolicy SslPolicy { get; set; } /// /// Gets operational state of the application gateway resource. @@ -127,8 +127,8 @@ public ApplicationGateway() { } /// /// Gets or sets SSL certificates of the application gateway resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.SSLCertificates")] - public System.Collections.Generic.IList SSLCertificates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sslCertificates")] + public System.Collections.Generic.IList SslCertificates { get; set; } /// /// Gets or sets frontend IP addresses of the application gateway diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayHttpListener.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayHttpListener.cs index 6d10a88d58b50..12d4d54e6ac63 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayHttpListener.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayHttpListener.cs @@ -34,7 +34,7 @@ public ApplicationGatewayHttpListener() { } /// Protocol. Possible values are: 'Http' and /// 'Https'. Possible values include: 'Http', 'Https' /// Host name of HTTP listener. - /// SSL certificate resource of an + /// SSL certificate resource of an /// application gateway. /// Applicable only if /// protocol is https. Enables SNI for multi-hosting. @@ -46,14 +46,14 @@ public ApplicationGatewayHttpListener() { } /// resource. /// A unique read-only string that changes whenever /// the resource is updated. - public ApplicationGatewayHttpListener(string id = default(string), SubResource frontendIPConfiguration = default(SubResource), SubResource frontendPort = default(SubResource), string protocol = default(string), string hostName = default(string), SubResource sSLCertificate = default(SubResource), bool? requireServerNameIndication = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string)) + public ApplicationGatewayHttpListener(string id = default(string), SubResource frontendIPConfiguration = default(SubResource), SubResource frontendPort = default(SubResource), string protocol = default(string), string hostName = default(string), SubResource sslCertificate = default(SubResource), bool? requireServerNameIndication = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { FrontendIPConfiguration = frontendIPConfiguration; FrontendPort = frontendPort; Protocol = protocol; HostName = hostName; - SSLCertificate = sSLCertificate; + SslCertificate = sslCertificate; RequireServerNameIndication = requireServerNameIndication; ProvisioningState = provisioningState; Name = name; @@ -89,8 +89,8 @@ public ApplicationGatewayHttpListener() { } /// /// Gets or sets SSL certificate resource of an application gateway. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.SSLCertificate")] - public SubResource SSLCertificate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sslCertificate")] + public SubResource SslCertificate { get; set; } /// /// Gets or sets applicable only if protocol is https. Enables SNI for diff --git a/src/ResourceManagement/Network/Network.Tests/Tests/ApplicationGatewayTests.cs b/src/ResourceManagement/Network/Network.Tests/Tests/ApplicationGatewayTests.cs index c7cd7052472ad..4f219c9759ec6 100644 --- a/src/ResourceManagement/Network/Network.Tests/Tests/ApplicationGatewayTests.cs +++ b/src/ResourceManagement/Network/Network.Tests/Tests/ApplicationGatewayTests.cs @@ -96,7 +96,7 @@ private ApplicationGateway CreateApplicationGateway(string location, Subnet subn var appGw = new ApplicationGateway() { Location = location, - SSLPolicy = new ApplicationGatewaySslPolicy() + SslPolicy = new ApplicationGatewaySslPolicy() { DisabledSslProtocols = new List() { @@ -232,7 +232,7 @@ private ApplicationGateway CreateApplicationGateway(string location, Subnet subn Id = GetChildAppGwResourceId(subscriptionId, resourceGroupName, appGwName, "frontendIPConfigurations", frontendIPConfigName) }, - SSLCertificate = null, + SslCertificate = null, Protocol = ApplicationGatewayProtocol.Http }, new ApplicationGatewayHttpListener() @@ -248,7 +248,7 @@ private ApplicationGateway CreateApplicationGateway(string location, Subnet subn Id = GetChildAppGwResourceId(subscriptionId, resourceGroupName, appGwName, "frontendIPConfigurations", frontendIPConfigName) }, - SSLCertificate = null, + SslCertificate = null, Protocol = ApplicationGatewayProtocol.Http }, //new ApplicationGatewayHttpListener() @@ -399,7 +399,7 @@ private void CompareApplicationGateway(ApplicationGateway gw1, ApplicationGatewa Assert.Equal(gw1.BackendHttpSettingsCollection.Count, gw2.BackendHttpSettingsCollection.Count); Assert.Equal(gw1.HttpListeners.Count, gw2.HttpListeners.Count); Assert.Equal(gw1.RequestRoutingRules.Count, gw2.RequestRoutingRules.Count); - Assert.Equal(gw1.SSLPolicy.DisabledSslProtocols.Count, gw2.SSLPolicy.DisabledSslProtocols.Count); + Assert.Equal(gw1.SslPolicy.DisabledSslProtocols.Count, gw2.SslPolicy.DisabledSslProtocols.Count); Assert.Equal(gw1.AuthenticationCertificates.Count, gw2.AuthenticationCertificates.Count); Assert.Equal(gw1.WebApplicationFirewallConfiguration.Enabled, gw2.WebApplicationFirewallConfiguration.Enabled); Assert.Equal(gw1.WebApplicationFirewallConfiguration.FirewallMode, gw2.WebApplicationFirewallConfiguration.FirewallMode); From 7d411eb96cc4f32b3c7a184fc9144eba6e440138 Mon Sep 17 00:00:00 2001 From: Deepak Rajendran Date: Tue, 6 Dec 2016 17:51:49 -0800 Subject: [PATCH 4/6] use latest autorest --- .../ApplicationGatewaysOperations.cs | 1180 +++++++------ ...ApplicationGatewaysOperationsExtensions.cs | 263 +-- ...essRouteCircuitAuthorizationsOperations.cs | 641 +++---- ...rcuitAuthorizationsOperationsExtensions.cs | 145 +- .../ExpressRouteCircuitPeeringsOperations.cs | 637 +++---- ...outeCircuitPeeringsOperationsExtensions.cs | 133 +- .../ExpressRouteCircuitsOperations.cs | 1568 +++++++++-------- ...xpressRouteCircuitsOperationsExtensions.cs | 383 ++-- .../ExpressRouteServiceProvidersOperations.cs | 166 +- ...uteServiceProvidersOperationsExtensions.cs | 25 +- .../IApplicationGatewaysOperations.cs | 128 +- ...essRouteCircuitAuthorizationsOperations.cs | 76 +- .../IExpressRouteCircuitPeeringsOperations.cs | 72 +- .../IExpressRouteCircuitsOperations.cs | 184 +- ...IExpressRouteServiceProvidersOperations.cs | 18 +- .../Generated/ILoadBalancersOperations.cs | 88 +- .../ILocalNetworkGatewaysOperations.cs | 66 +- .../Generated/INetworkInterfacesOperations.cs | 144 +- .../Generated/INetworkManagementClient.cs | 26 +- .../INetworkSecurityGroupsOperations.cs | 92 +- .../Generated/IPublicIpAddressesOperations.cs | 90 +- .../Generated/IRouteTablesOperations.cs | 84 +- .../Generated/IRoutesOperations.cs | 62 +- .../Generated/ISecurityRulesOperations.cs | 70 +- .../Generated/ISubnetsOperations.cs | 66 +- .../Generated/IUsagesOperations.cs | 18 +- ...tualNetworkGatewayConnectionsOperations.cs | 142 +- .../IVirtualNetworkGatewaysOperations.cs | 102 +- .../IVirtualNetworkPeeringsOperations.cs | 70 +- .../Generated/IVirtualNetworksOperations.cs | 100 +- .../Generated/LoadBalancersOperations.cs | 809 +++++---- .../LoadBalancersOperationsExtensions.cs | 175 +- .../LocalNetworkGatewaysOperations.cs | 617 +++---- ...ocalNetworkGatewaysOperationsExtensions.cs | 123 +- .../Generated/Models/AddressSpace.cs | 25 +- .../Generated/Models/ApplicationGateway.cs | 99 +- ...icationGatewayAuthenticationCertificate.cs | 21 +- .../ApplicationGatewayBackendAddress.cs | 13 +- .../ApplicationGatewayBackendAddressPool.cs | 39 +- .../Models/ApplicationGatewayBackendHealth.cs | 17 +- ...icationGatewayBackendHealthHttpSettings.cs | 23 +- .../ApplicationGatewayBackendHealthPool.cs | 19 +- .../ApplicationGatewayBackendHealthServer.cs | 21 +- ...icationGatewayBackendHealthServerHealth.cs | 8 +- .../ApplicationGatewayBackendHttpSettings.cs | 46 +- .../ApplicationGatewayCookieBasedAffinity.cs | 8 +- .../Models/ApplicationGatewayFirewallMode.cs | 8 +- ...plicationGatewayFrontendIpConfiguration.cs | 35 +- .../Models/ApplicationGatewayFrontendPort.cs | 21 +- .../Models/ApplicationGatewayHttpListener.cs | 39 +- .../ApplicationGatewayIpConfiguration.cs | 29 +- .../ApplicationGatewayOperationalState.cs | 8 +- .../Models/ApplicationGatewayPathRule.cs | 40 +- .../Models/ApplicationGatewayProbe.cs | 59 +- .../Models/ApplicationGatewayProtocol.cs | 8 +- .../ApplicationGatewayRequestRoutingRule.cs | 33 +- ...pplicationGatewayRequestRoutingRuleType.cs | 8 +- .../Generated/Models/ApplicationGatewaySku.cs | 21 +- .../Models/ApplicationGatewaySkuName.cs | 8 +- .../ApplicationGatewaySslCertificate.cs | 33 +- .../Models/ApplicationGatewaySslPolicy.cs | 21 +- .../Models/ApplicationGatewaySslProtocol.cs | 8 +- .../Models/ApplicationGatewayTier.cs | 8 +- .../Models/ApplicationGatewayUrlPathMap.cs | 31 +- ...ewayWebApplicationFirewallConfiguration.cs | 24 +- .../Models/AuthorizationUseStatus.cs | 8 +- .../Models/AzureAsyncOperationResult.cs | 23 +- .../Generated/Models/BackendAddressPool.cs | 43 +- .../Generated/Models/BgpSettings.cs | 19 +- .../Models/ConnectionResetSharedKey.cs | 26 +- .../Generated/Models/ConnectionSharedKey.cs | 16 +- .../Generated/Models/DhcpOptions.cs | 17 +- .../Models/DnsNameAvailabilityResult.cs | 11 +- .../Models/EffectiveNetworkSecurityGroup.cs | 25 +- ...ffectiveNetworkSecurityGroupAssociation.cs | 13 +- ...EffectiveNetworkSecurityGroupListResult.cs | 19 +- .../Models/EffectiveNetworkSecurityRule.cs | 53 +- .../Generated/Models/EffectiveRoute.cs | 42 +- .../Models/EffectiveRouteListResult.cs | 19 +- .../Generated/Models/EffectiveRouteSource.cs | 8 +- .../Generated/Models/EffectiveRouteState.cs | 8 +- .../Generated/Models/Error.cs | 25 +- .../Generated/Models/ErrorDetails.cs | 15 +- .../Generated/Models/ExpressRouteCircuit.cs | 49 +- .../Models/ExpressRouteCircuitArpTable.cs | 17 +- .../ExpressRouteCircuitAuthorization.cs | 23 +- .../Models/ExpressRouteCircuitPeering.cs | 56 +- ...rcuitPeeringAdvertisedPublicPrefixState.cs | 8 +- .../ExpressRouteCircuitPeeringConfig.cs | 27 +- .../Models/ExpressRouteCircuitPeeringState.cs | 8 +- .../Models/ExpressRouteCircuitPeeringType.cs | 8 +- .../Models/ExpressRouteCircuitRoutesTable.cs | 19 +- .../ExpressRouteCircuitRoutesTableSummary.cs | 29 +- ...ssRouteCircuitServiceProviderProperties.cs | 15 +- .../Models/ExpressRouteCircuitSku.cs | 15 +- .../Models/ExpressRouteCircuitSkuFamily.cs | 8 +- .../Models/ExpressRouteCircuitSkuTier.cs | 8 +- .../Models/ExpressRouteCircuitStats.cs | 17 +- .../ExpressRouteCircuitsArpTableListResult.cs | 19 +- ...pressRouteCircuitsRoutesTableListResult.cs | 23 +- ...uteCircuitsRoutesTableSummaryListResult.cs | 23 +- .../Models/ExpressRouteServiceProvider.cs | 27 +- ...ssRouteServiceProviderBandwidthsOffered.cs | 13 +- .../Models/FrontendIpConfiguration.cs | 55 +- .../Models/IPAddressAvailabilityResult.cs | 23 +- .../Generated/Models/IPConfiguration.cs | 35 +- .../Generated/Models/IPVersion.cs | 8 +- .../Generated/Models/InboundNatPool.cs | 62 +- .../Generated/Models/InboundNatRule.cs | 64 +- .../Generated/Models/IpAllocationMethod.cs | 8 +- .../Generated/Models/LoadBalancer.cs | 101 +- .../Generated/Models/LoadBalancingRule.cs | 91 +- .../Generated/Models/LoadDistribution.cs | 8 +- .../Generated/Models/LocalNetworkGateway.cs | 35 +- .../Generated/Models/NetworkInterface.cs | 45 +- .../Models/NetworkInterfaceDnsSettings.cs | 52 +- .../Models/NetworkInterfaceIpConfiguration.cs | 61 +- .../Models/NetworkOperationStatus.cs | 8 +- .../Generated/Models/NetworkSecurityGroup.cs | 43 +- .../Generated/Models/OutboundNatRule.cs | 47 +- .../Generated/Models/Page.cs | 31 +- .../Generated/Models/Probe.cs | 103 +- .../Generated/Models/ProbeProtocol.cs | 8 +- .../Generated/Models/ProcessorArchitecture.cs | 8 +- .../Generated/Models/PublicIpAddress.cs | 51 +- .../Models/PublicIpAddressDnsSettings.cs | 37 +- .../Generated/Models/Resource.cs | 33 +- .../Models/ResourceNavigationLink.cs | 27 +- .../Generated/Models/Route.cs | 41 +- .../Generated/Models/RouteNextHopType.cs | 8 +- .../Generated/Models/RouteTable.cs | 29 +- .../Generated/Models/SecurityRule.cs | 83 +- .../Generated/Models/SecurityRuleAccess.cs | 8 +- .../Generated/Models/SecurityRuleDirection.cs | 8 +- .../Generated/Models/SecurityRuleProtocol.cs | 8 +- .../ServiceProviderProvisioningState.cs | 8 +- .../Generated/Models/SubResource.cs | 15 +- .../Generated/Models/Subnet.cs | 41 +- .../Generated/Models/TransportProtocol.cs | 8 +- .../Models/TunnelConnectionHealth.cs | 33 +- .../Generated/Models/Usage.cs | 22 +- .../Generated/Models/UsageName.cs | 13 +- .../Generated/Models/VirtualNetwork.cs | 47 +- .../Generated/Models/VirtualNetworkGateway.cs | 76 +- .../Models/VirtualNetworkGatewayConnection.cs | 91 +- .../VirtualNetworkGatewayConnectionStatus.cs | 8 +- .../VirtualNetworkGatewayConnectionType.cs | 8 +- .../VirtualNetworkGatewayIpConfiguration.cs | 41 +- .../Models/VirtualNetworkGatewaySku.cs | 22 +- .../Models/VirtualNetworkGatewaySkuName.cs | 8 +- .../Models/VirtualNetworkGatewaySkuTier.cs | 8 +- .../Models/VirtualNetworkGatewayType.cs | 8 +- .../Generated/Models/VirtualNetworkPeering.cs | 58 +- .../Models/VirtualNetworkPeeringState.cs | 8 +- .../Models/VpnClientConfiguration.cs | 27 +- .../Generated/Models/VpnClientParameters.cs | 16 +- .../Models/VpnClientRevokedCertificate.cs | 27 +- .../Models/VpnClientRootCertificate.cs | 35 +- .../Generated/Models/VpnType.cs | 8 +- .../Generated/NetworkInterfacesOperations.cs | 1528 ++++++++-------- .../NetworkInterfacesOperationsExtensions.cs | 275 +-- .../Generated/NetworkManagementClient.cs | 212 +-- .../NetworkManagementClientExtensions.cs | 17 +- .../NetworkSecurityGroupsOperations.cs | 817 ++++----- ...tworkSecurityGroupsOperationsExtensions.cs | 183 +- .../Generated/PublicIpAddressesOperations.cs | 811 +++++---- .../PublicIpAddressesOperationsExtensions.cs | 175 +- .../Generated/RouteTablesOperations.cs | 815 ++++----- .../RouteTablesOperationsExtensions.cs | 173 +- .../Generated/RoutesOperations.cs | 641 +++---- .../Generated/RoutesOperationsExtensions.cs | 125 +- .../Generated/SecurityRulesOperations.cs | 645 +++---- .../SecurityRulesOperationsExtensions.cs | 133 +- .../Generated/SubnetsOperations.cs | 647 +++---- .../Generated/SubnetsOperationsExtensions.cs | 133 +- .../Generated/UsagesOperations.cs | 170 +- .../Generated/UsagesOperationsExtensions.cs | 25 +- ...tualNetworkGatewayConnectionsOperations.cs | 1010 ++++++----- ...kGatewayConnectionsOperationsExtensions.cs | 283 +-- .../VirtualNetworkGatewaysOperations.cs | 877 ++++----- ...tualNetworkGatewaysOperationsExtensions.cs | 211 +-- .../VirtualNetworkPeeringsOperations.cs | 641 +++---- ...tualNetworkPeeringsOperationsExtensions.cs | 141 +- .../Generated/VirtualNetworksOperations.cs | 908 +++++----- .../VirtualNetworksOperationsExtensions.cs | 195 +- .../generate.cmd | 4 +- 186 files changed, 12702 insertions(+), 11104 deletions(-) diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperations.cs index 3e29976bb1bf8..0143ba5e5f86b 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// ApplicationGatewaysOperations operations. /// - internal partial class ApplicationGatewaysOperations : Microsoft.Rest.IServiceOperations, IApplicationGatewaysOperations + internal partial class ApplicationGatewaysOperations : IServiceOperations, IApplicationGatewaysOperations { /// /// Initializes a new instance of the ApplicationGatewaysOperations class. @@ -29,11 +38,11 @@ internal partial class ApplicationGatewaysOperations : Microsoft.Rest.IServiceOp /// internal ApplicationGatewaysOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -56,16 +65,16 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, applicationGatewayName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// Deletes the specified application gateway. + /// Gets the specified application gateway. /// /// /// The name of the resource group. @@ -79,77 +88,83 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (applicationGatewayName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -166,43 +181,51 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + 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; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,22 +235,40 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets the specified application gateway. + /// Creates or updates the specified application gateway. /// /// /// The name of the resource group. @@ -235,86 +276,108 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The name of the application gateway. /// + /// + /// Parameters supplied to the create or update application gateway operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, applicationGatewayName, parameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Lists all application gateways in a resource group. + /// + /// + /// The name of the resource group. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (applicationGatewayName == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.ApiVersion == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -331,35 +394,35 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -367,15 +430,15 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -385,7 +448,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -398,7 +461,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -407,145 +470,90 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Creates or updates the specified application gateway. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Parameters supplied to the create or update application gateway operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, applicationGatewayName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// Creates or updates the specified application gateway. + /// Gets all the application gateways in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Parameters supplied to the create or update application gateway operation. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (applicationGatewayName == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (parameters == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("applicationGatewayName", applicationGatewayName); - tracingParameters.Add("parameters", parameters); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -561,42 +569,36 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -604,15 +606,15 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -622,7 +624,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -630,30 +632,12 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -662,96 +646,179 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Lists all application gateways in a resource group. + /// Starts the specified application gateway. /// /// /// The name of the resource group. /// + /// + /// The name of the application gateway. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task StartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync( + resourceGroupName, applicationGatewayName, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// Stops the specified application gateway in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task StopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync( + resourceGroupName, applicationGatewayName, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// Gets the backend health of the specified application gateway in a resource + /// group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// Expands BackendAddressPool and BackendHttpSettings referenced in backend + /// health. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> BackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginBackendHealthWithHttpMessagesAsync( + resourceGroupName, applicationGatewayName, expand, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// Deletes the specified application gateway. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (applicationGatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + } + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -768,51 +835,43 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 202 && (int)_statusCode != 204 && (int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (Newtonsoft.Json.JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -822,109 +881,124 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all the application gateways in a subscription. + /// Creates or updates the specified application gateway. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// Parameters supplied to the create or update application gateway operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.ApiVersion == null) + if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.SubscriptionId == null) + if (applicationGatewayName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("applicationGatewayName", applicationGatewayName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -940,36 +1014,42 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 201 && (int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -977,15 +1057,15 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -995,7 +1075,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1003,12 +1083,30 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1017,39 +1115,16 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } - /// - /// Starts the specified application gateway. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task StartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync( - resourceGroupName, applicationGatewayName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - /// /// Starts the specified application gateway. /// @@ -1065,77 +1140,80 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (applicationGatewayName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1152,43 +1230,43 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); } else { _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1198,7 +1276,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1207,34 +1285,11 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } - /// - /// Stops the specified application gateway in a resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task StopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync( - resourceGroupName, applicationGatewayName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - /// /// Stops the specified application gateway in a resource group. /// @@ -1250,77 +1305,80 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (applicationGatewayName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStop", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginStop", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1337,43 +1395,43 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); } else { _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1383,7 +1441,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1392,39 +1450,11 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } - /// - /// Gets the backend health of the specified application gateway in a resource - /// group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Expands BackendAddressPool and BackendHttpSettings referenced in backend - /// health. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> BackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginBackendHealthWithHttpMessagesAsync( - resourceGroupName, applicationGatewayName, expand, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - /// /// Gets the backend health of the specified application gateway in a resource /// group. @@ -1445,59 +1475,62 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginBackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginBackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (applicationGatewayName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationGatewayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginBackendHealth", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginBackendHealth", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (expand != null) { @@ -1508,22 +1541,22 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1540,35 +1573,35 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1576,15 +1609,15 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1594,7 +1627,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1607,7 +1640,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1616,12 +1649,12 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1638,60 +1671,63 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1708,35 +1744,35 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1744,15 +1780,15 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1762,7 +1798,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1775,7 +1811,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1784,12 +1820,12 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1806,60 +1842,63 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1876,35 +1915,35 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1912,15 +1951,15 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1930,7 +1969,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1943,7 +1982,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1952,15 +1991,16 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperationsExtensions.cs index 2c6b2d7fa89cd..a78bd394c71f0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for ApplicationGatewaysOperations. @@ -31,7 +35,7 @@ public static partial class ApplicationGatewaysOperationsExtensions /// public static void Delete(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).DeleteAsync(resourceGroupName, applicationGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).DeleteAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -49,13 +53,13 @@ public static void Delete(this IApplicationGatewaysOperations operations, string /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// Deletes the specified application gateway. + /// Gets the specified application gateway. /// /// /// The operations group for this extension method. @@ -66,13 +70,13 @@ public static void Delete(this IApplicationGatewaysOperations operations, string /// /// The name of the application gateway. /// - public static void BeginDelete(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) + public static ApplicationGateway Get(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginDeleteAsync(resourceGroupName, applicationGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).GetAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Deletes the specified application gateway. + /// Gets the specified application gateway. /// /// /// The operations group for this extension method. @@ -86,13 +90,16 @@ public static void BeginDelete(this IApplicationGatewaysOperations operations, s /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Gets the specified application gateway. + /// Creates or updates the specified application gateway. /// /// /// The operations group for this extension method. @@ -103,13 +110,16 @@ public static void BeginDelete(this IApplicationGatewaysOperations operations, s /// /// The name of the application gateway. /// - public static ApplicationGateway Get(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) + /// + /// Parameters supplied to the create or update application gateway operation. + /// + public static ApplicationGateway CreateOrUpdate(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).GetAsync(resourceGroupName, applicationGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).CreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets the specified application gateway. + /// Creates or updates the specified application gateway. /// /// /// The operations group for this extension method. @@ -120,19 +130,22 @@ public static ApplicationGateway Get(this IApplicationGatewaysOperations operati /// /// The name of the application gateway. /// + /// + /// Parameters supplied to the create or update application gateway operation. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates the specified application gateway. + /// Lists all application gateways in a resource group. /// /// /// The operations group for this extension method. @@ -140,19 +153,13 @@ public static ApplicationGateway Get(this IApplicationGatewaysOperations operati /// /// The name of the resource group. /// - /// - /// The name of the application gateway. - /// - /// - /// Parameters supplied to the create or update application gateway operation. - /// - public static ApplicationGateway CreateOrUpdate(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters) + public static IPage List(this IApplicationGatewaysOperations operations, string resourceGroupName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).CreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Creates or updates the specified application gateway. + /// Lists all application gateways in a resource group. /// /// /// The operations group for this extension method. @@ -160,71 +167,47 @@ public static ApplicationGateway CreateOrUpdate(this IApplicationGatewaysOperati /// /// The name of the resource group. /// - /// - /// The name of the application gateway. - /// - /// - /// Parameters supplied to the create or update application gateway operation. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates the specified application gateway. + /// Gets all the application gateways in a subscription. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Parameters supplied to the create or update application gateway operation. - /// - public static ApplicationGateway BeginCreateOrUpdate(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters) + public static IPage ListAll(this IApplicationGatewaysOperations operations) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Creates or updates the specified application gateway. + /// Gets all the application gateways in a subscription. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Parameters supplied to the create or update application gateway operation. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAllAsync(this IApplicationGatewaysOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists all application gateways in a resource group. + /// Starts the specified application gateway. /// /// /// The operations group for this extension method. @@ -232,13 +215,16 @@ public static ApplicationGateway BeginCreateOrUpdate(this IApplicationGatewaysOp /// /// The name of the resource group. /// - public static Microsoft.Rest.Azure.IPage List(this IApplicationGatewaysOperations operations, string resourceGroupName) + /// + /// The name of the application gateway. + /// + public static void Start(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).StartAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Lists all application gateways in a resource group. + /// Starts the specified application gateway. /// /// /// The operations group for this extension method. @@ -246,47 +232,57 @@ public static Microsoft.Rest.Azure.IPage List(this IApplicat /// /// The name of the resource group. /// + /// + /// The name of the application gateway. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task StartAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.StartWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// Gets all the application gateways in a subscription. + /// Stops the specified application gateway in a resource group. /// /// /// The operations group for this extension method. /// - public static Microsoft.Rest.Azure.IPage ListAll(this IApplicationGatewaysOperations operations) + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + public static void Stop(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).ListAllAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).StopAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all the application gateways in a subscription. + /// Stops the specified application gateway in a resource group. /// /// /// The operations group for this extension method. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// /// /// The cancellation token. /// - public static async Task> ListAllAsync(this IApplicationGatewaysOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task StopAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.StopWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// Starts the specified application gateway. + /// Gets the backend health of the specified application gateway in a resource + /// group. /// /// /// The operations group for this extension method. @@ -297,13 +293,18 @@ public static Microsoft.Rest.Azure.IPage ListAll(this IAppli /// /// The name of the application gateway. /// - public static void Start(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) + /// + /// Expands BackendAddressPool and BackendHttpSettings referenced in backend + /// health. + /// + public static ApplicationGatewayBackendHealth BackendHealth(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string)) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).StartAsync(resourceGroupName, applicationGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BackendHealthAsync(resourceGroupName, applicationGatewayName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Starts the specified application gateway. + /// Gets the backend health of the specified application gateway in a resource + /// group. /// /// /// The operations group for this extension method. @@ -314,16 +315,23 @@ public static void Start(this IApplicationGatewaysOperations operations, string /// /// The name of the application gateway. /// + /// + /// Expands BackendAddressPool and BackendHttpSettings referenced in backend + /// health. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task StartAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BackendHealthAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - await operations.StartWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.BackendHealthWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Starts the specified application gateway. + /// Deletes the specified application gateway. /// /// /// The operations group for this extension method. @@ -334,13 +342,13 @@ public static void Start(this IApplicationGatewaysOperations operations, string /// /// The name of the application gateway. /// - public static void BeginStart(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) + public static void BeginDelete(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginStartAsync(resourceGroupName, applicationGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginDeleteAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Starts the specified application gateway. + /// Deletes the specified application gateway. /// /// /// The operations group for this extension method. @@ -354,13 +362,13 @@ public static void BeginStart(this IApplicationGatewaysOperations operations, st /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginStartAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginDeleteAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// Stops the specified application gateway in a resource group. + /// Creates or updates the specified application gateway. /// /// /// The operations group for this extension method. @@ -371,13 +379,16 @@ public static void BeginStart(this IApplicationGatewaysOperations operations, st /// /// The name of the application gateway. /// - public static void Stop(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) + /// + /// Parameters supplied to the create or update application gateway operation. + /// + public static ApplicationGateway BeginCreateOrUpdate(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).StopAsync(resourceGroupName, applicationGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Stops the specified application gateway in a resource group. + /// Creates or updates the specified application gateway. /// /// /// The operations group for this extension method. @@ -388,16 +399,22 @@ public static void Stop(this IApplicationGatewaysOperations operations, string r /// /// The name of the application gateway. /// + /// + /// Parameters supplied to the create or update application gateway operation. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task StopAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.StopWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Stops the specified application gateway in a resource group. + /// Starts the specified application gateway. /// /// /// The operations group for this extension method. @@ -408,13 +425,13 @@ public static void Stop(this IApplicationGatewaysOperations operations, string r /// /// The name of the application gateway. /// - public static void BeginStop(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) + public static void BeginStart(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginStopAsync(resourceGroupName, applicationGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginStartAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Stops the specified application gateway in a resource group. + /// Starts the specified application gateway. /// /// /// The operations group for this extension method. @@ -428,14 +445,13 @@ public static void BeginStop(this IApplicationGatewaysOperations operations, str /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginStopAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginStartAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginStopWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); + await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// Gets the backend health of the specified application gateway in a resource - /// group. + /// Stops the specified application gateway in a resource group. /// /// /// The operations group for this extension method. @@ -446,18 +462,13 @@ public static void BeginStop(this IApplicationGatewaysOperations operations, str /// /// The name of the application gateway. /// - /// - /// Expands BackendAddressPool and BackendHttpSettings referenced in backend - /// health. - /// - public static ApplicationGatewayBackendHealth BackendHealth(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string)) + public static void BeginStop(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BackendHealthAsync(resourceGroupName, applicationGatewayName, expand), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginStopAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets the backend health of the specified application gateway in a resource - /// group. + /// Stops the specified application gateway in a resource group. /// /// /// The operations group for this extension method. @@ -468,19 +479,12 @@ public static void BeginStop(this IApplicationGatewaysOperations operations, str /// /// The name of the application gateway. /// - /// - /// Expands BackendAddressPool and BackendHttpSettings referenced in backend - /// health. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BackendHealthAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginStopAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BackendHealthWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginStopWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); } /// @@ -502,7 +506,7 @@ public static void BeginStop(this IApplicationGatewaysOperations operations, str /// public static ApplicationGatewayBackendHealth BeginBackendHealth(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -525,7 +529,7 @@ public static void BeginStop(this IApplicationGatewaysOperations operations, str /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginBackendHealthAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginBackendHealthAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginBackendHealthWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, expand, null, cancellationToken).ConfigureAwait(false)) { @@ -542,9 +546,9 @@ public static void BeginStop(this IApplicationGatewaysOperations operations, str /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this IApplicationGatewaysOperations operations, string nextPageLink) + public static IPage ListNext(this IApplicationGatewaysOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -559,7 +563,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IAppl /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IApplicationGatewaysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IApplicationGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -576,9 +580,9 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IAppl /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListAllNext(this IApplicationGatewaysOperations operations, string nextPageLink) + public static IPage ListAllNext(this IApplicationGatewaysOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).ListAllNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).ListAllNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -593,7 +597,7 @@ public static Microsoft.Rest.Azure.IPage ListAllNext(this IA /// /// The cancellation token. /// - public static async Task> ListAllNextAsync(this IApplicationGatewaysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAllNextAsync(this IApplicationGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -603,3 +607,4 @@ public static Microsoft.Rest.Azure.IPage ListAllNext(this IA } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs index d4dc99c45dd22..fd66038bc4346 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// ExpressRouteCircuitAuthorizationsOperations operations. /// - internal partial class ExpressRouteCircuitAuthorizationsOperations : Microsoft.Rest.IServiceOperations, IExpressRouteCircuitAuthorizationsOperations + internal partial class ExpressRouteCircuitAuthorizationsOperations : IServiceOperations, IExpressRouteCircuitAuthorizationsOperations { /// /// Initializes a new instance of the ExpressRouteCircuitAuthorizationsOperations class. @@ -29,11 +38,11 @@ internal partial class ExpressRouteCircuitAuthorizationsOperations : Microsoft.R /// internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -60,17 +69,16 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, circuitName, authorizationName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// Deletes the specified authorization from the specified express route - /// circuit. + /// Gets the specified authorization from the specified express route circuit. /// /// /// The name of the resource group. @@ -87,83 +95,89 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } if (authorizationName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "authorizationName"); + throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("authorizationName", authorizationName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -180,43 +194,51 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + 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; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -226,22 +248,40 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets the specified authorization from the specified express route circuit. + /// Creates or updates an authorization in the specified express route circuit. /// /// /// The name of the resource group. @@ -252,92 +292,118 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The name of the authorization. /// + /// + /// Parameters supplied to the create or update express route circuit + /// authorization operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, circuitName, authorizationName, authorizationParameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all authorizations in an express route circuit. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the circuit. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } - if (authorizationName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "authorizationName"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); - tracingParameters.Add("authorizationName", authorizationName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -354,35 +420,35 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -390,15 +456,15 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -408,7 +474,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -421,7 +487,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -430,50 +496,19 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Creates or updates an authorization in the specified express route circuit. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the authorization. - /// - /// - /// Parameters supplied to the create or update express route circuit - /// authorization operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, circuitName, authorizationName, authorizationParameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// Creates or updates an authorization in the specified express route circuit. + /// Deletes the specified authorization from the specified express route + /// circuit. /// /// /// The name of the resource group. @@ -484,101 +519,92 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The name of the authorization. /// - /// - /// Parameters supplied to the create or update express route circuit - /// authorization 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 System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } if (authorizationName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "authorizationName"); + throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); } - if (authorizationParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "authorizationParameters"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("authorizationName", authorizationName); - tracingParameters.Add("authorizationParameters", authorizationParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -594,58 +620,44 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli // Serialize Request string _requestContent = null; - if(authorizationParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(authorizationParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 200) + if ((int)_statusCode != 202 && (int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (Newtonsoft.Json.JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -655,64 +667,35 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all authorizations in an express route circuit. + /// Creates or updates an authorization in the specified express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. + /// + /// + /// The name of the authorization. + /// + /// + /// Parameters supplied to the create or update express route circuit + /// authorization operation. /// /// /// Headers that will be added to request. @@ -720,80 +703,94 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + } + if (authorizationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); + } + if (authorizationParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "authorizationParameters"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); + tracingParameters.Add("authorizationName", authorizationName); + tracingParameters.Add("authorizationParameters", authorizationParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -809,36 +806,42 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli // Serialize Request string _requestContent = null; + if(authorizationParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(authorizationParameters, Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 201 && (int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -846,15 +849,15 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -864,7 +867,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -872,12 +875,30 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -886,12 +907,12 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -908,60 +929,63 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -978,35 +1002,35 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1014,15 +1038,15 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1032,7 +1056,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1045,7 +1069,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1054,15 +1078,16 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperationsExtensions.cs index 25ed26019615d..fafae6709630e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for ExpressRouteCircuitAuthorizationsOperations. @@ -35,7 +39,7 @@ public static partial class ExpressRouteCircuitAuthorizationsOperationsExtension /// public static void Delete(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).DeleteAsync(resourceGroupName, circuitName, authorizationName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).DeleteAsync(resourceGroupName, circuitName, authorizationName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -57,14 +61,13 @@ public static void Delete(this IExpressRouteCircuitAuthorizationsOperations oper /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false); } /// - /// Deletes the specified authorization from the specified express route - /// circuit. + /// Gets the specified authorization from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -78,14 +81,13 @@ public static void Delete(this IExpressRouteCircuitAuthorizationsOperations oper /// /// The name of the authorization. /// - public static void BeginDelete(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName) + public static ExpressRouteCircuitAuthorization Get(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).BeginDeleteAsync(resourceGroupName, circuitName, authorizationName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).GetAsync(resourceGroupName, circuitName, authorizationName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Deletes the specified authorization from the specified express route - /// circuit. + /// Gets the specified authorization from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -102,13 +104,16 @@ public static void BeginDelete(this IExpressRouteCircuitAuthorizationsOperations /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Gets the specified authorization from the specified express route circuit. + /// Creates or updates an authorization in the specified express route circuit. /// /// /// The operations group for this extension method. @@ -122,13 +127,17 @@ public static void BeginDelete(this IExpressRouteCircuitAuthorizationsOperations /// /// The name of the authorization. /// - public static ExpressRouteCircuitAuthorization Get(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName) + /// + /// Parameters supplied to the create or update express route circuit + /// authorization operation. + /// + public static ExpressRouteCircuitAuthorization CreateOrUpdate(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).GetAsync(resourceGroupName, circuitName, authorizationName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).CreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets the specified authorization from the specified express route circuit. + /// Creates or updates an authorization in the specified express route circuit. /// /// /// The operations group for this extension method. @@ -142,19 +151,23 @@ public static ExpressRouteCircuitAuthorization Get(this IExpressRouteCircuitAuth /// /// The name of the authorization. /// + /// + /// Parameters supplied to the create or update express route circuit + /// authorization operation. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates an authorization in the specified express route circuit. + /// Gets all authorizations in an express route circuit. /// /// /// The operations group for this extension method. @@ -163,22 +176,15 @@ public static ExpressRouteCircuitAuthorization Get(this IExpressRouteCircuitAuth /// The name of the resource group. /// /// - /// The name of the express route circuit. - /// - /// - /// The name of the authorization. - /// - /// - /// Parameters supplied to the create or update express route circuit - /// authorization operation. + /// The name of the circuit. /// - public static ExpressRouteCircuitAuthorization CreateOrUpdate(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters) + public static IPage List(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).CreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).ListAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Creates or updates an authorization in the specified express route circuit. + /// Gets all authorizations in an express route circuit. /// /// /// The operations group for this extension method. @@ -187,28 +193,22 @@ public static ExpressRouteCircuitAuthorization CreateOrUpdate(this IExpressRoute /// The name of the resource group. /// /// - /// The name of the express route circuit. - /// - /// - /// The name of the authorization. - /// - /// - /// Parameters supplied to the create or update express route circuit - /// authorization operation. + /// The name of the circuit. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates an authorization in the specified express route circuit. + /// Deletes the specified authorization from the specified express route + /// circuit. /// /// /// The operations group for this extension method. @@ -222,17 +222,14 @@ public static ExpressRouteCircuitAuthorization CreateOrUpdate(this IExpressRoute /// /// The name of the authorization. /// - /// - /// Parameters supplied to the create or update express route circuit - /// authorization operation. - /// - public static ExpressRouteCircuitAuthorization BeginCreateOrUpdate(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters) + public static void BeginDelete(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).BeginDeleteAsync(resourceGroupName, circuitName, authorizationName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Creates or updates an authorization in the specified express route circuit. + /// Deletes the specified authorization from the specified express route + /// circuit. /// /// /// The operations group for this extension method. @@ -246,23 +243,16 @@ public static ExpressRouteCircuitAuthorization BeginCreateOrUpdate(this IExpress /// /// The name of the authorization. /// - /// - /// Parameters supplied to the create or update express route circuit - /// authorization operation. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginDeleteAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false); } /// - /// Gets all authorizations in an express route circuit. + /// Creates or updates an authorization in the specified express route circuit. /// /// /// The operations group for this extension method. @@ -271,15 +261,22 @@ public static ExpressRouteCircuitAuthorization BeginCreateOrUpdate(this IExpress /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// - public static Microsoft.Rest.Azure.IPage List(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName) + /// + /// The name of the authorization. + /// + /// + /// Parameters supplied to the create or update express route circuit + /// authorization operation. + /// + public static ExpressRouteCircuitAuthorization BeginCreateOrUpdate(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).ListAsync(resourceGroupName, circuitName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all authorizations in an express route circuit. + /// Creates or updates an authorization in the specified express route circuit. /// /// /// The operations group for this extension method. @@ -288,14 +285,21 @@ public static Microsoft.Rest.Azure.IPage List( /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. + /// + /// + /// The name of the authorization. + /// + /// + /// Parameters supplied to the create or update express route circuit + /// authorization operation. /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -310,9 +314,9 @@ public static Microsoft.Rest.Azure.IPage List( /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this IExpressRouteCircuitAuthorizationsOperations operations, string nextPageLink) + public static IPage ListNext(this IExpressRouteCircuitAuthorizationsOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -327,7 +331,7 @@ public static Microsoft.Rest.Azure.IPage ListN /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -337,3 +341,4 @@ public static Microsoft.Rest.Azure.IPage ListN } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs index e258e03e0fb9c..281211912838d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// ExpressRouteCircuitPeeringsOperations operations. /// - internal partial class ExpressRouteCircuitPeeringsOperations : Microsoft.Rest.IServiceOperations, IExpressRouteCircuitPeeringsOperations + internal partial class ExpressRouteCircuitPeeringsOperations : IServiceOperations, IExpressRouteCircuitPeeringsOperations { /// /// Initializes a new instance of the ExpressRouteCircuitPeeringsOperations class. @@ -29,11 +38,11 @@ internal partial class ExpressRouteCircuitPeeringsOperations : Microsoft.Rest.IS /// internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -59,16 +68,16 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, circuitName, peeringName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// Deletes the specified peering from the specified express route circuit. + /// Gets the specified authorization from the specified express route circuit. /// /// /// The name of the resource group. @@ -85,83 +94,89 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } if (peeringName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -178,43 +193,51 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + 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; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -224,22 +247,40 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets the specified authorization from the specified express route circuit. + /// Creates or updates a peering in the specified express route circuits. /// /// /// The name of the resource group. @@ -250,92 +291,118 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The name of the peering. /// + /// + /// Parameters supplied to the create or update express route circuit peering + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, circuitName, peeringName, peeringParameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all peerings in a specified express route circuit. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); - } - if (peeringName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); - tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -352,35 +419,35 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -388,15 +455,15 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -406,7 +473,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -419,7 +486,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -428,50 +495,18 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Creates or updates a peering in the specified express route circuits. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update express route circuit peering - /// operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, circuitName, peeringName, peeringParameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// Creates or updates a peering in the specified express route circuits. + /// Deletes the specified peering from the specified express route circuit. /// /// /// The name of the resource group. @@ -482,101 +517,92 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The name of the peering. /// - /// - /// Parameters supplied to the create or update express route circuit 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 System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } if (peeringName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); } - if (peeringParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringParameters"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); - tracingParameters.Add("peeringParameters", peeringParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -592,58 +618,44 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(peeringParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(peeringParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (Newtonsoft.Json.JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -653,58 +665,22 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all peerings in a specified express route circuit. + /// Creates or updates a peering in the specified express route circuits. /// /// /// The name of the resource group. @@ -712,86 +688,107 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The name of the express route circuit. /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update express route circuit peering + /// operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (peeringParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringParameters"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("peeringParameters", peeringParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -807,36 +804,42 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(peeringParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(peeringParameters, Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -844,15 +847,15 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -862,7 +865,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -875,7 +878,25 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -884,12 +905,12 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -906,60 +927,63 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -976,35 +1000,35 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1012,15 +1036,15 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1030,7 +1054,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1043,7 +1067,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1052,15 +1076,16 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperationsExtensions.cs index 5ac76651bc03f..55b658fbd637a 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for ExpressRouteCircuitPeeringsOperations. @@ -34,7 +38,7 @@ public static partial class ExpressRouteCircuitPeeringsOperationsExtensions /// public static void Delete(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).DeleteAsync(resourceGroupName, circuitName, peeringName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).DeleteAsync(resourceGroupName, circuitName, peeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -55,13 +59,13 @@ public static void Delete(this IExpressRouteCircuitPeeringsOperations operations /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false); } /// - /// Deletes the specified peering from the specified express route circuit. + /// Gets the specified authorization from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -75,13 +79,13 @@ public static void Delete(this IExpressRouteCircuitPeeringsOperations operations /// /// The name of the peering. /// - public static void BeginDelete(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName) + public static ExpressRouteCircuitPeering Get(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).BeginDeleteAsync(resourceGroupName, circuitName, peeringName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).GetAsync(resourceGroupName, circuitName, peeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Deletes the specified peering from the specified express route circuit. + /// Gets the specified authorization from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -98,13 +102,16 @@ public static void BeginDelete(this IExpressRouteCircuitPeeringsOperations opera /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Gets the specified authorization from the specified express route circuit. + /// Creates or updates a peering in the specified express route circuits. /// /// /// The operations group for this extension method. @@ -118,13 +125,17 @@ public static void BeginDelete(this IExpressRouteCircuitPeeringsOperations opera /// /// The name of the peering. /// - public static ExpressRouteCircuitPeering Get(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName) + /// + /// Parameters supplied to the create or update express route circuit peering + /// operation. + /// + public static ExpressRouteCircuitPeering CreateOrUpdate(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).GetAsync(resourceGroupName, circuitName, peeringName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).CreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets the specified authorization from the specified express route circuit. + /// Creates or updates a peering in the specified express route circuits. /// /// /// The operations group for this extension method. @@ -138,19 +149,23 @@ public static ExpressRouteCircuitPeering Get(this IExpressRouteCircuitPeeringsOp /// /// The name of the peering. /// + /// + /// Parameters supplied to the create or update express route circuit peering + /// operation. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates a peering in the specified express route circuits. + /// Gets all peerings in a specified express route circuit. /// /// /// The operations group for this extension method. @@ -161,20 +176,13 @@ public static ExpressRouteCircuitPeering Get(this IExpressRouteCircuitPeeringsOp /// /// The name of the express route circuit. /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update express route circuit peering - /// operation. - /// - public static ExpressRouteCircuitPeering CreateOrUpdate(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters) + public static IPage List(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).CreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).ListAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Creates or updates a peering in the specified express route circuits. + /// Gets all peerings in a specified express route circuit. /// /// /// The operations group for this extension method. @@ -185,26 +193,19 @@ public static ExpressRouteCircuitPeering CreateOrUpdate(this IExpressRouteCircui /// /// The name of the express route circuit. /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update express route circuit peering - /// operation. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates a peering in the specified express route circuits. + /// Deletes the specified peering from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -218,17 +219,13 @@ public static ExpressRouteCircuitPeering CreateOrUpdate(this IExpressRouteCircui /// /// The name of the peering. /// - /// - /// Parameters supplied to the create or update express route circuit peering - /// operation. - /// - public static ExpressRouteCircuitPeering BeginCreateOrUpdate(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters) + public static void BeginDelete(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).BeginDeleteAsync(resourceGroupName, circuitName, peeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Creates or updates a peering in the specified express route circuits. + /// Deletes the specified peering from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -242,23 +239,16 @@ public static ExpressRouteCircuitPeering BeginCreateOrUpdate(this IExpressRouteC /// /// The name of the peering. /// - /// - /// Parameters supplied to the create or update express route circuit peering - /// operation. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginDeleteAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false); } /// - /// Gets all peerings in a specified express route circuit. + /// Creates or updates a peering in the specified express route circuits. /// /// /// The operations group for this extension method. @@ -269,13 +259,20 @@ public static ExpressRouteCircuitPeering BeginCreateOrUpdate(this IExpressRouteC /// /// The name of the express route circuit. /// - public static Microsoft.Rest.Azure.IPage List(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName) + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update express route circuit peering + /// operation. + /// + public static ExpressRouteCircuitPeering BeginCreateOrUpdate(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).ListAsync(resourceGroupName, circuitName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all peerings in a specified express route circuit. + /// Creates or updates a peering in the specified express route circuits. /// /// /// The operations group for this extension method. @@ -286,12 +283,19 @@ public static Microsoft.Rest.Azure.IPage List(this I /// /// The name of the express route circuit. /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update express route circuit peering + /// operation. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -306,9 +310,9 @@ public static Microsoft.Rest.Azure.IPage List(this I /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this IExpressRouteCircuitPeeringsOperations operations, string nextPageLink) + public static IPage ListNext(this IExpressRouteCircuitPeeringsOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -323,7 +327,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(th /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IExpressRouteCircuitPeeringsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IExpressRouteCircuitPeeringsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -333,3 +337,4 @@ public static Microsoft.Rest.Azure.IPage ListNext(th } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperations.cs index a068441d73772..26840a95ae0a4 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// ExpressRouteCircuitsOperations operations. /// - internal partial class ExpressRouteCircuitsOperations : Microsoft.Rest.IServiceOperations, IExpressRouteCircuitsOperations + internal partial class ExpressRouteCircuitsOperations : IServiceOperations, IExpressRouteCircuitsOperations { /// /// Initializes a new instance of the ExpressRouteCircuitsOperations class. @@ -29,11 +38,11 @@ internal partial class ExpressRouteCircuitsOperations : Microsoft.Rest.IServiceO /// internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -56,22 +65,22 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, circuitName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// Deletes the specified express route circuit. + /// Gets information about the specified express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the express route circuit. + /// The name of express route circuit. /// /// /// Headers that will be added to request. @@ -79,77 +88,83 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -166,43 +181,51 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + 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; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,28 +235,165 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets information about the specified express route circuit. + /// Creates or updates an express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of express route circuit. + /// The name of the circuit. + /// + /// + /// Parameters supplied to the create or update express route circuit + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, circuitName, parameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListArpTableWithHttpMessagesAsync( + resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListRoutesTableWithHttpMessagesAsync( + resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListRoutesTableSummaryWithHttpMessagesAsync( + resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// Gets all the stats from an express route circuit in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. /// /// /// Headers that will be added to request. @@ -241,80 +401,83 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStats", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -331,35 +494,35 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -367,15 +530,15 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -385,7 +548,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -398,7 +561,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -407,57 +570,27 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Creates or updates an express route circuit. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// Parameters supplied to the create or update express route circuit - /// operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, circuitName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// Creates or updates an express route circuit. + /// Gets all stats from an express route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// - /// - /// Parameters supplied to the create or update express route circuit - /// operation. + /// + /// The name of the peering. /// /// /// Headers that will be added to request. @@ -465,85 +598,89 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetPeeringStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } - if (parameters == null) + if (peeringName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPeeringStats", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -559,42 +696,36 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -602,15 +733,15 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -620,7 +751,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -628,30 +759,12 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -660,154 +773,99 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets the currently advertised ARP table associated with the express route - /// circuit in a resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginListArpTableWithHttpMessagesAsync( - resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - - /// - /// Gets the currently advertised ARP table associated with the express route - /// circuit in a resource group. + /// Gets all the express route circuits in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (circuitName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); - } - if (peeringName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); - } - if (devicePath == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "devicePath"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("circuitName", circuitName); - tracingParameters.Add("peeringName", peeringName); - tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListArpTable", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -824,35 +882,35 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -860,15 +918,15 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -878,7 +936,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -891,7 +949,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -900,154 +958,90 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets the currently advertised routes table associated with the express - /// route circuit in a resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginListRoutesTableWithHttpMessagesAsync( - resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - - /// - /// Gets the currently advertised routes table associated with the express - /// route circuit in a resource group. + /// Gets all the express route circuits in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (resourceGroupName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (circuitName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); - } - if (peeringName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); - } - if (devicePath == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "devicePath"); - } - if (this.Client.ApiVersion == null) + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("circuitName", circuitName); - tracingParameters.Add("peeringName", peeringName); - tracingParameters.Add("devicePath", devicePath); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTable", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1064,35 +1058,35 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1100,15 +1094,15 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1118,7 +1112,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1131,7 +1125,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1140,49 +1134,18 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets the currently advertised routes table summary associated with the - /// express route circuit in a resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginListRoutesTableSummaryWithHttpMessagesAsync( - resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - - /// - /// Gets the currently advertised routes table summary associated with the - /// express route circuit in a resource group. + /// Deletes the specified express route circuit. /// /// /// The name of the resource group. @@ -1190,104 +1153,86 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The name of the express route circuit. /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response + /// + /// Thrown when a required parameter is null /// - /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); - } - if (peeringName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); - } - if (devicePath == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "devicePath"); + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); - tracingParameters.Add("peeringName", peeringName); - tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTableSummary", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1304,51 +1249,43 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (Newtonsoft.Json.JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1358,46 +1295,32 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all the stats from an express route circuit in a resource group. + /// Creates or updates an express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the express route circuit. + /// The name of the circuit. + /// + /// + /// Parameters supplied to the create or update express route circuit + /// operation. /// /// /// Headers that will be added to request. @@ -1405,80 +1328,88 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetStats", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1494,36 +1425,42 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 201 && (int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1531,15 +1468,15 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1549,7 +1486,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1557,12 +1494,30 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1571,18 +1526,19 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all stats from an express route circuit in a resource group. + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. /// /// /// The name of the resource group. @@ -1593,92 +1549,104 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// 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 System.Threading.Tasks.Task> GetPeeringStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "circuitName"); + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } if (peeringName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "peeringName"); + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (devicePath == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetPeeringStats", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginListArpTable", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1695,35 +1663,35 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1731,15 +1699,15 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1749,7 +1717,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1762,7 +1730,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1771,96 +1739,127 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all the express route circuits in a resource group. + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. /// /// /// The name of the resource group. /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (circuitName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (devicePath == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("circuitName", circuitName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTable", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1877,35 +1876,35 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1913,15 +1912,15 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1931,7 +1930,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1944,7 +1943,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1953,87 +1952,127 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all the express route circuits in a subscription. + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.ApiVersion == null) + if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.SubscriptionId == null) + if (circuitName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (devicePath == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("circuitName", circuitName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTableSummary", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -2050,35 +2089,35 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2086,15 +2125,15 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2104,7 +2143,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2117,7 +2156,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2126,12 +2165,12 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2148,60 +2187,63 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -2218,35 +2260,35 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2254,15 +2296,15 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2272,7 +2314,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2285,7 +2327,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2294,12 +2336,12 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2316,60 +2358,63 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -2386,35 +2431,35 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2422,15 +2467,15 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2440,7 +2485,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2453,7 +2498,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2462,15 +2507,16 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperationsExtensions.cs index 8cf7875c6aa1e..5d301fb8da0e2 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for ExpressRouteCircuitsOperations. @@ -31,7 +35,7 @@ public static partial class ExpressRouteCircuitsOperationsExtensions /// public static void Delete(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).DeleteAsync(resourceGroupName, circuitName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).DeleteAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -49,48 +53,11 @@ public static void Delete(this IExpressRouteCircuitsOperations operations, strin /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false); } - /// - /// Deletes 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. - /// - public static void BeginDelete(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) - { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginDeleteAsync(resourceGroupName, circuitName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); - } - - /// - /// Deletes 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 cancellation token. - /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false); - } - /// /// Gets information about the specified express route circuit. /// @@ -105,7 +72,7 @@ public static void BeginDelete(this IExpressRouteCircuitsOperations operations, /// public static ExpressRouteCircuit Get(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).GetAsync(resourceGroupName, circuitName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).GetAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -123,7 +90,7 @@ public static ExpressRouteCircuit Get(this IExpressRouteCircuitsOperations opera /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) { @@ -149,7 +116,7 @@ public static ExpressRouteCircuit Get(this IExpressRouteCircuitsOperations opera /// public static ExpressRouteCircuit CreateOrUpdate(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).CreateOrUpdateAsync(resourceGroupName, circuitName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).CreateOrUpdateAsync(resourceGroupName, circuitName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -171,7 +138,7 @@ public static ExpressRouteCircuit CreateOrUpdate(this IExpressRouteCircuitsOpera /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -180,7 +147,8 @@ public static ExpressRouteCircuit CreateOrUpdate(this IExpressRouteCircuitsOpera } /// - /// Creates or updates an express route circuit. + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. /// /// /// The operations group for this extension method. @@ -189,19 +157,22 @@ public static ExpressRouteCircuit CreateOrUpdate(this IExpressRouteCircuitsOpera /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// - /// - /// Parameters supplied to the create or update express route circuit - /// operation. + /// + /// The name of the peering. /// - public static ExpressRouteCircuit BeginCreateOrUpdate(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters) + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Creates or updates an express route circuit. + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. /// /// /// The operations group for this extension method. @@ -210,26 +181,28 @@ public static ExpressRouteCircuit BeginCreateOrUpdate(this IExpressRouteCircuits /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// - /// - /// Parameters supplied to the create or update express route circuit - /// operation. + /// + /// The name of the peering. + /// + /// + /// The path of the device. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task ListArpTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListArpTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the currently advertised ARP table associated with the express route - /// circuit in a resource group. + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -246,14 +219,14 @@ public static ExpressRouteCircuit BeginCreateOrUpdate(this IExpressRouteCircuits /// /// The path of the device. /// - public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) + public static ExpressRouteCircuitsRoutesTableListResult ListRoutesTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets the currently advertised ARP table associated with the express route - /// circuit in a resource group. + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -273,17 +246,17 @@ public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressR /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task ListArpTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task ListRoutesTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListArpTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListRoutesTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the currently advertised ARP table associated with the express route - /// circuit in a resource group. + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -300,14 +273,14 @@ public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressR /// /// The path of the device. /// - public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) + public static ExpressRouteCircuitsRoutesTableSummaryListResult ListRoutesTableSummary(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets the currently advertised ARP table associated with the express route - /// circuit in a resource group. + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -327,17 +300,16 @@ public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExp /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginListArpTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task ListRoutesTableSummaryAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginListArpTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the currently advertised routes table associated with the express - /// route circuit in a resource group. + /// Gets all the stats from an express route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -348,20 +320,13 @@ public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExp /// /// The name of the express route circuit. /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - public static ExpressRouteCircuitsRoutesTableListResult ListRoutesTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) + public static ExpressRouteCircuitStats GetStats(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).GetStatsAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets the currently advertised routes table associated with the express - /// route circuit in a resource group. + /// Gets all the stats from an express route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -372,26 +337,19 @@ public static ExpressRouteCircuitsRoutesTableListResult ListRoutesTable(this IEx /// /// The name of the express route circuit. /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task ListRoutesTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetStatsAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListRoutesTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetStatsWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the currently advertised routes table associated with the express - /// route circuit in a resource group. + /// Gets all stats from an express route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -405,17 +363,13 @@ public static ExpressRouteCircuitsRoutesTableListResult ListRoutesTable(this IEx /// /// The name of the peering. /// - /// - /// The path of the device. - /// - public static ExpressRouteCircuitsRoutesTableListResult BeginListRoutesTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) + public static ExpressRouteCircuitStats GetPeeringStats(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).GetPeeringStatsAsync(resourceGroupName, circuitName, peeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets the currently advertised routes table associated with the express - /// route circuit in a resource group. + /// Gets all stats from an express route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -429,23 +383,19 @@ public static ExpressRouteCircuitsRoutesTableListResult BeginListRoutesTable(thi /// /// The name of the peering. /// - /// - /// The path of the device. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginListRoutesTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetPeeringStatsAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginListRoutesTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetPeeringStatsWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the currently advertised routes table summary associated with the - /// express route circuit in a resource group. + /// Gets all the express route circuits in a resource group. /// /// /// The operations group for this extension method. @@ -453,23 +403,13 @@ public static ExpressRouteCircuitsRoutesTableListResult BeginListRoutesTable(thi /// /// The name of the resource group. /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - public static ExpressRouteCircuitsRoutesTableSummaryListResult ListRoutesTableSummary(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) + public static IPage List(this IExpressRouteCircuitsOperations operations, string resourceGroupName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets the currently advertised routes table summary associated with the - /// express route circuit in a resource group. + /// Gets all the express route circuits in a resource group. /// /// /// The operations group for this extension method. @@ -477,29 +417,47 @@ public static ExpressRouteCircuitsRoutesTableSummaryListResult ListRoutesTableSu /// /// The name of the resource group. /// - /// - /// The name of the express route circuit. + /// + /// The cancellation token. /// - /// - /// The name of the peering. + public static async Task> ListAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all the express route circuits in a subscription. + /// + /// + /// The operations group for this extension method. /// - /// - /// The path of the device. + public static IPage ListAll(this IExpressRouteCircuitsOperations operations) + { + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Gets all the express route circuits in a subscription. + /// + /// + /// The operations group for this extension method. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task ListRoutesTableSummaryAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAllAsync(this IExpressRouteCircuitsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the currently advertised routes table summary associated with the - /// express route circuit in a resource group. + /// Deletes the specified express route circuit. /// /// /// The operations group for this extension method. @@ -510,20 +468,13 @@ public static ExpressRouteCircuitsRoutesTableSummaryListResult ListRoutesTableSu /// /// The name of the express route circuit. /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - public static ExpressRouteCircuitsRoutesTableSummaryListResult BeginListRoutesTableSummary(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) + public static void BeginDelete(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginDeleteAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets the currently advertised routes table summary associated with the - /// express route circuit in a resource group. + /// Deletes the specified express route circuit. /// /// /// The operations group for this extension method. @@ -534,25 +485,16 @@ public static ExpressRouteCircuitsRoutesTableSummaryListResult BeginListRoutesTa /// /// The name of the express route circuit. /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginListRoutesTableSummaryAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginDeleteAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false); } /// - /// Gets all the stats from an express route circuit in a resource group. + /// Creates or updates an express route circuit. /// /// /// The operations group for this extension method. @@ -561,15 +503,19 @@ public static ExpressRouteCircuitsRoutesTableSummaryListResult BeginListRoutesTa /// The name of the resource group. /// /// - /// The name of the express route circuit. + /// The name of the circuit. /// - public static ExpressRouteCircuitStats GetStats(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) + /// + /// Parameters supplied to the create or update express route circuit + /// operation. + /// + public static ExpressRouteCircuit BeginCreateOrUpdate(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).GetStatsAsync(resourceGroupName, circuitName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all the stats from an express route circuit in a resource group. + /// Creates or updates an express route circuit. /// /// /// The operations group for this extension method. @@ -578,21 +524,26 @@ public static ExpressRouteCircuitStats GetStats(this IExpressRouteCircuitsOperat /// The name of the resource group. /// /// - /// The name of the express route circuit. + /// The name of the circuit. + /// + /// + /// Parameters supplied to the create or update express route circuit + /// operation. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetStatsAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetStatsWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets all stats from an express route circuit in a resource group. + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. /// /// /// The operations group for this extension method. @@ -606,13 +557,17 @@ public static ExpressRouteCircuitStats GetStats(this IExpressRouteCircuitsOperat /// /// The name of the peering. /// - public static ExpressRouteCircuitStats GetPeeringStats(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName) + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).GetPeeringStatsAsync(resourceGroupName, circuitName, peeringName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all stats from an express route circuit in a resource group. + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. /// /// /// The operations group for this extension method. @@ -626,19 +581,23 @@ public static ExpressRouteCircuitStats GetPeeringStats(this IExpressRouteCircuit /// /// The name of the peering. /// + /// + /// The path of the device. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetPeeringStatsAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginListArpTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetPeeringStatsWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginListArpTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets all the express route circuits in a resource group. + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -646,13 +605,23 @@ public static ExpressRouteCircuitStats GetPeeringStats(this IExpressRouteCircuit /// /// The name of the resource group. /// - public static Microsoft.Rest.Azure.IPage List(this IExpressRouteCircuitsOperations operations, string resourceGroupName) + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsRoutesTableListResult BeginListRoutesTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all the express route circuits in a resource group. + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -660,40 +629,75 @@ public static Microsoft.Rest.Azure.IPage List(this IExpress /// /// The name of the resource group. /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginListRoutesTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginListRoutesTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets all the express route circuits in a subscription. + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. /// /// /// The operations group for this extension method. /// - public static Microsoft.Rest.Azure.IPage ListAll(this IExpressRouteCircuitsOperations operations) + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsRoutesTableSummaryListResult BeginListRoutesTableSummary(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListAllAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all the express route circuits in a subscription. + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. /// /// /// The operations group for this extension method. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// /// /// The cancellation token. /// - public static async Task> ListAllAsync(this IExpressRouteCircuitsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginListRoutesTableSummaryAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -708,9 +712,9 @@ public static Microsoft.Rest.Azure.IPage ListAll(this IExpr /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this IExpressRouteCircuitsOperations operations, string nextPageLink) + public static IPage ListNext(this IExpressRouteCircuitsOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -725,7 +729,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IExp /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IExpressRouteCircuitsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IExpressRouteCircuitsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -742,9 +746,9 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IExp /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListAllNext(this IExpressRouteCircuitsOperations operations, string nextPageLink) + public static IPage ListAllNext(this IExpressRouteCircuitsOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListAllNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListAllNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -759,7 +763,7 @@ public static Microsoft.Rest.Azure.IPage ListAllNext(this I /// /// The cancellation token. /// - public static async Task> ListAllNextAsync(this IExpressRouteCircuitsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAllNextAsync(this IExpressRouteCircuitsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -769,3 +773,4 @@ public static Microsoft.Rest.Azure.IPage ListAllNext(this I } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs index ef64997d26768..de50388bc5a26 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// ExpressRouteServiceProvidersOperations operations. /// - internal partial class ExpressRouteServiceProvidersOperations : Microsoft.Rest.IServiceOperations, IExpressRouteServiceProvidersOperations + internal partial class ExpressRouteServiceProvidersOperations : IServiceOperations, IExpressRouteServiceProvidersOperations { /// /// Initializes a new instance of the ExpressRouteServiceProvidersOperations class. @@ -29,11 +38,11 @@ internal partial class ExpressRouteServiceProvidersOperations : Microsoft.Rest.I /// internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -50,68 +59,71 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -128,35 +140,35 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -164,15 +176,15 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -182,7 +194,7 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -195,7 +207,7 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -204,12 +216,12 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -226,60 +238,63 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -296,35 +311,35 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -332,15 +347,15 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -350,7 +365,7 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -363,7 +378,7 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -372,15 +387,16 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperationsExtensions.cs index 874bb346e49ac..4299f3dfa7f9e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for ExpressRouteServiceProvidersOperations. @@ -23,9 +27,9 @@ public static partial class ExpressRouteServiceProvidersOperationsExtensions /// /// The operations group for this extension method. /// - public static Microsoft.Rest.Azure.IPage List(this IExpressRouteServiceProvidersOperations operations) + public static IPage List(this IExpressRouteServiceProvidersOperations operations) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteServiceProvidersOperations)s).ListAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteServiceProvidersOperations)s).ListAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -37,7 +41,7 @@ public static Microsoft.Rest.Azure.IPage List(this /// /// The cancellation token. /// - public static async Task> ListAsync(this IExpressRouteServiceProvidersOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IExpressRouteServiceProvidersOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -54,9 +58,9 @@ public static Microsoft.Rest.Azure.IPage List(this /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this IExpressRouteServiceProvidersOperations operations, string nextPageLink) + public static IPage ListNext(this IExpressRouteServiceProvidersOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IExpressRouteServiceProvidersOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteServiceProvidersOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -71,7 +75,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(t /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IExpressRouteServiceProvidersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IExpressRouteServiceProvidersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -81,3 +85,4 @@ public static Microsoft.Rest.Azure.IPage ListNext(t } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IApplicationGatewaysOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IApplicationGatewaysOperations.cs index 77a0a54ba6f12..b91024daec0de 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IApplicationGatewaysOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IApplicationGatewaysOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// ApplicationGatewaysOperations operations. @@ -37,9 +44,9 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified application gateway. + /// Gets the specified application gateway. /// /// /// The name of the resource group. @@ -56,12 +63,15 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the specified application gateway. + /// Creates or updates the specified application gateway. /// /// /// The name of the resource group. @@ -69,6 +79,10 @@ public partial interface IApplicationGatewaysOperations /// /// The name of the application gateway. /// + /// + /// Parameters supplied to the create or update application gateway + /// operation. + /// /// /// The headers that will be added to request. /// @@ -84,20 +98,13 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates the specified application gateway. + /// Lists all application gateways in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the application gateway. - /// - /// - /// Parameters supplied to the create or update application gateway - /// operation. - /// /// /// The headers that will be added to request. /// @@ -113,20 +120,10 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates the specified application gateway. + /// Gets all the application gateways in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Parameters supplied to the create or update application gateway - /// operation. - /// /// /// The headers that will be added to request. /// @@ -142,13 +139,16 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists all application gateways in a resource group. + /// Starts the specified application gateway. /// /// /// The name of the resource group. /// + /// + /// The name of the application gateway. + /// /// /// The headers that will be added to request. /// @@ -158,16 +158,19 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task StartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all the application gateways in a subscription. + /// Stops the specified application gateway in a resource group. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// /// /// The headers that will be added to request. /// @@ -177,15 +180,13 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task StopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Starts the specified application gateway. + /// Gets the backend health of the specified application gateway in a + /// resource group. /// /// /// The name of the resource group. @@ -193,6 +194,10 @@ public partial interface IApplicationGatewaysOperations /// /// The name of the application gateway. /// + /// + /// Expands BackendAddressPool and BackendHttpSettings referenced in + /// backend health. + /// /// /// The headers that will be added to request. /// @@ -202,12 +207,15 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task StartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Starts the specified application gateway. + /// Deletes the specified application gateway. /// /// /// The name of the resource group. @@ -227,9 +235,9 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Stops the specified application gateway in a resource group. + /// Creates or updates the specified application gateway. /// /// /// The name of the resource group. @@ -237,6 +245,10 @@ public partial interface IApplicationGatewaysOperations /// /// The name of the application gateway. /// + /// + /// Parameters supplied to the create or update application gateway + /// operation. + /// /// /// The headers that will be added to request. /// @@ -246,12 +258,15 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task StopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Stops the specified application gateway in a resource group. + /// Starts the specified application gateway. /// /// /// The name of the resource group. @@ -271,10 +286,9 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the backend health of the specified application gateway in a - /// resource group. + /// Stops the specified application gateway in a resource group. /// /// /// The name of the resource group. @@ -282,10 +296,6 @@ public partial interface IApplicationGatewaysOperations /// /// The name of the application gateway. /// - /// - /// Expands BackendAddressPool and BackendHttpSettings referenced in - /// backend health. - /// /// /// The headers that will be added to request. /// @@ -295,13 +305,10 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the backend health of the specified application gateway in a /// resource group. @@ -331,7 +338,7 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginBackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginBackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all application gateways in a resource group. /// @@ -353,7 +360,7 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all the application gateways in a subscription. /// @@ -375,6 +382,7 @@ public partial interface IApplicationGatewaysOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitAuthorizationsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitAuthorizationsOperations.cs index fb5e8b7344e43..91d20a267edb4 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitAuthorizationsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitAuthorizationsOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// ExpressRouteCircuitAuthorizationsOperations operations. @@ -41,10 +48,10 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified authorization from the specified express - /// route circuit. + /// Gets the specified authorization from the specified express route + /// circuit. /// /// /// The name of the resource group. @@ -64,12 +71,15 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the specified authorization from the specified express route + /// Creates or updates an authorization in the specified express route /// circuit. /// /// @@ -81,6 +91,10 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// The name of the authorization. /// + /// + /// Parameters supplied to the create or update express route circuit + /// authorization operation. + /// /// /// The headers that will be added to request. /// @@ -96,23 +110,15 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates an authorization in the specified express route - /// circuit. + /// Gets all authorizations in an express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the express route circuit. - /// - /// - /// The name of the authorization. - /// - /// - /// Parameters supplied to the create or update express route circuit - /// authorization operation. + /// The name of the circuit. /// /// /// The headers that will be added to request. @@ -129,10 +135,10 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates an authorization in the specified express route - /// circuit. + /// Deletes the specified authorization from the specified express + /// route circuit. /// /// /// The name of the resource group. @@ -143,10 +149,6 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// The name of the authorization. /// - /// - /// Parameters supplied to the create or update express route circuit - /// authorization operation. - /// /// /// The headers that will be added to request. /// @@ -156,21 +158,26 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all authorizations in an express route circuit. + /// Creates or updates an authorization in the specified express route + /// circuit. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. + /// + /// + /// The name of the authorization. + /// + /// + /// Parameters supplied to the create or update express route circuit + /// authorization operation. /// /// /// The headers that will be added to request. @@ -187,7 +194,7 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all authorizations in an express route circuit. /// @@ -209,6 +216,7 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitPeeringsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitPeeringsOperations.cs index 761dde57e452c..bad2aab8cf056 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitPeeringsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitPeeringsOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// ExpressRouteCircuitPeeringsOperations operations. @@ -41,9 +48,9 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified peering from the specified express route + /// Gets the specified authorization from the specified express route /// circuit. /// /// @@ -64,13 +71,16 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the specified authorization from the specified express route - /// circuit. + /// Creates or updates a peering in the specified express route + /// circuits. /// /// /// The name of the resource group. @@ -81,6 +91,10 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// The name of the peering. /// + /// + /// Parameters supplied to the create or update express route circuit + /// peering operation. + /// /// /// The headers that will be added to request. /// @@ -96,10 +110,9 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a peering in the specified express route - /// circuits. + /// Gets all peerings in a specified express route circuit. /// /// /// The name of the resource group. @@ -107,13 +120,6 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// The name of the express route circuit. /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update express route circuit - /// peering operation. - /// /// /// The headers that will be added to request. /// @@ -129,10 +135,10 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a peering in the specified express route - /// circuits. + /// Deletes the specified peering from the specified express route + /// circuit. /// /// /// The name of the resource group. @@ -143,10 +149,6 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// The name of the peering. /// - /// - /// Parameters supplied to the create or update express route circuit - /// peering operation. - /// /// /// The headers that will be added to request. /// @@ -156,15 +158,13 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all peerings in a specified express route circuit. + /// Creates or updates a peering in the specified express route + /// circuits. /// /// /// The name of the resource group. @@ -172,6 +172,13 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// The name of the express route circuit. /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update express route circuit + /// peering operation. + /// /// /// The headers that will be added to request. /// @@ -187,7 +194,7 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all peerings in a specified express route circuit. /// @@ -209,6 +216,7 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitsOperations.cs index 152e526849ab2..4f776a90e113f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitsOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// ExpressRouteCircuitsOperations operations. @@ -37,29 +44,7 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// Deletes the specified express route circuit. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets information about the specified express route circuit. /// @@ -84,7 +69,7 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates or updates an express route circuit. /// @@ -113,19 +98,22 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates an express route circuit. + /// Gets the currently advertised ARP table associated with the express + /// route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// - /// - /// Parameters supplied to the create or update express route circuit - /// operation. + /// + /// The name of the peering. + /// + /// + /// The path of the device. /// /// /// The headers that will be added to request. @@ -142,9 +130,9 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the currently advertised ARP table associated with the + /// Gets the currently advertised routes table associated with the /// express route circuit in a resource group. /// /// @@ -174,10 +162,10 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the currently advertised ARP table associated with the - /// express route circuit in a resource group. + /// Gets the currently advertised routes table summary associated with + /// the express route circuit in a resource group. /// /// /// The name of the resource group. @@ -206,10 +194,10 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the currently advertised routes table associated with the - /// express route circuit in a resource group. + /// Gets all the stats from an express route circuit in a resource + /// group. /// /// /// The name of the resource group. @@ -217,12 +205,6 @@ public partial interface IExpressRouteCircuitsOperations /// /// The name of the express route circuit. /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// /// /// The headers that will be added to request. /// @@ -238,10 +220,9 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the currently advertised routes table associated with the - /// express route circuit in a resource group. + /// Gets all stats from an express route circuit in a resource group. /// /// /// The name of the resource group. @@ -252,9 +233,6 @@ public partial interface IExpressRouteCircuitsOperations /// /// The name of the peering. /// - /// - /// The path of the device. - /// /// /// The headers that will be added to request. /// @@ -270,23 +248,32 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetPeeringStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the currently advertised routes table summary associated with - /// the express route circuit in a resource group. + /// Gets all the express route circuits in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. + /// + /// The headers that will be added to request. /// - /// - /// The path of the device. + /// + /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the express route circuits in a subscription. + /// /// /// The headers that will be added to request. /// @@ -302,10 +289,9 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the currently advertised routes table summary associated with - /// the express route circuit in a resource group. + /// Deletes the specified express route circuit. /// /// /// The name of the resource group. @@ -313,12 +299,6 @@ public partial interface IExpressRouteCircuitsOperations /// /// The name of the express route circuit. /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// /// /// The headers that will be added to request. /// @@ -328,22 +308,22 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all the stats from an express route circuit in a resource - /// group. + /// Creates or updates an express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the express route circuit. + /// The name of the circuit. + /// + /// + /// Parameters supplied to the create or update express route circuit + /// operation. /// /// /// The headers that will be added to request. @@ -360,9 +340,10 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all stats from an express route circuit in a resource group. + /// Gets the currently advertised ARP table associated with the express + /// route circuit in a resource group. /// /// /// The name of the resource group. @@ -373,6 +354,9 @@ public partial interface IExpressRouteCircuitsOperations /// /// The name of the peering. /// + /// + /// The path of the device. + /// /// /// The headers that will be added to request. /// @@ -388,13 +372,23 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetPeeringStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all the express route circuits in a resource group. + /// Gets the currently advertised routes table associated with the + /// express route circuit in a resource group. /// /// /// The name of the resource group. /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// /// /// The headers that will be added to request. /// @@ -410,10 +404,23 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all the express route circuits in a subscription. + /// Gets the currently advertised routes table summary associated with + /// the express route circuit in a resource group. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// /// /// The headers that will be added to request. /// @@ -429,7 +436,7 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all the express route circuits in a resource group. /// @@ -451,7 +458,7 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all the express route circuits in a subscription. /// @@ -473,6 +480,7 @@ public partial interface IExpressRouteCircuitsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteServiceProvidersOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteServiceProvidersOperations.cs index 04dc0e8cecc24..991744d758e2e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteServiceProvidersOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteServiceProvidersOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// ExpressRouteServiceProvidersOperations operations. @@ -34,7 +41,7 @@ public partial interface IExpressRouteServiceProvidersOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all the available express route service providers. /// @@ -56,6 +63,7 @@ public partial interface IExpressRouteServiceProvidersOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILoadBalancersOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILoadBalancersOperations.cs index 36e3e588c49cf..d0761541c3f09 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILoadBalancersOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILoadBalancersOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// LoadBalancersOperations operations. @@ -37,9 +44,9 @@ public partial interface ILoadBalancersOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified load balancer. + /// Gets the specified load balancer. /// /// /// The name of the resource group. @@ -47,6 +54,9 @@ public partial interface ILoadBalancersOperations /// /// The name of the load balancer. /// + /// + /// Expands referenced resources. + /// /// /// The headers that will be added to request. /// @@ -56,12 +66,15 @@ public partial interface ILoadBalancersOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the specified load balancer. + /// Creates or updates a load balancer. /// /// /// The name of the resource group. @@ -69,8 +82,9 @@ public partial interface ILoadBalancersOperations /// /// The name of the load balancer. /// - /// - /// Expands referenced resources. + /// + /// Parameters supplied to the create or update load balancer + /// operation. /// /// /// The headers that will be added to request. @@ -87,20 +101,10 @@ public partial interface ILoadBalancersOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a load balancer. + /// Gets all the load balancers in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// Parameters supplied to the create or update load balancer - /// operation. - /// /// /// The headers that will be added to request. /// @@ -116,20 +120,13 @@ public partial interface ILoadBalancersOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a load balancer. + /// Gets all the load balancers in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the load balancer. - /// - /// - /// Parameters supplied to the create or update load balancer - /// operation. - /// /// /// The headers that will be added to request. /// @@ -145,10 +142,16 @@ public partial interface ILoadBalancersOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all the load balancers in a subscription. + /// Deletes the specified load balancer. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// /// /// The headers that will be added to request. /// @@ -158,19 +161,23 @@ public partial interface ILoadBalancersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all the load balancers in a resource group. + /// Creates or updates a load balancer. /// /// /// The name of the resource group. /// + /// + /// The name of the load balancer. + /// + /// + /// Parameters supplied to the create or update load balancer + /// operation. + /// /// /// The headers that will be added to request. /// @@ -186,7 +193,7 @@ public partial interface ILoadBalancersOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all the load balancers in a subscription. /// @@ -208,7 +215,7 @@ public partial interface ILoadBalancersOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all the load balancers in a resource group. /// @@ -230,6 +237,7 @@ public partial interface ILoadBalancersOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILocalNetworkGatewaysOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILocalNetworkGatewaysOperations.cs index a0c15591abba3..fa331906ea339 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILocalNetworkGatewaysOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILocalNetworkGatewaysOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// LocalNetworkGatewaysOperations operations. @@ -45,10 +52,9 @@ public partial interface ILocalNetworkGatewaysOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a local network gateway in the specified - /// resource group. + /// Gets the specified local network gateway in a resource group. /// /// /// The name of the resource group. @@ -56,10 +62,6 @@ public partial interface ILocalNetworkGatewaysOperations /// /// The name of the local network gateway. /// - /// - /// Parameters supplied to the create or update local network gateway - /// operation. - /// /// /// The headers that will be added to request. /// @@ -75,9 +77,9 @@ public partial interface ILocalNetworkGatewaysOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the specified local network gateway in a resource group. + /// Deletes the specified local network gateway. /// /// /// The name of the resource group. @@ -94,22 +96,16 @@ public partial interface ILocalNetworkGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified local network gateway. + /// Gets all the local network gateways in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the local network gateway. - /// /// /// The headers that will be added to request. /// @@ -119,12 +115,16 @@ public partial interface ILocalNetworkGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified local network gateway. + /// Creates or updates a local network gateway in the specified + /// resource group. /// /// /// The name of the resource group. @@ -132,6 +132,10 @@ public partial interface ILocalNetworkGatewaysOperations /// /// The name of the local network gateway. /// + /// + /// Parameters supplied to the create or update local network gateway + /// operation. + /// /// /// The headers that will be added to request. /// @@ -141,16 +145,22 @@ public partial interface ILocalNetworkGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all the local network gateways in a resource group. + /// Deletes the specified local network gateway. /// /// /// The name of the resource group. /// + /// + /// The name of the local network gateway. + /// /// /// The headers that will be added to request. /// @@ -160,13 +170,10 @@ public partial interface ILocalNetworkGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all the local network gateways in a resource group. /// @@ -188,6 +195,7 @@ public partial interface ILocalNetworkGatewaysOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkInterfacesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkInterfacesOperations.cs index 34e9adae4a631..c35bc2e24de04 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkInterfacesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkInterfacesOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// NetworkInterfacesOperations operations. @@ -37,9 +44,9 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified network interface. + /// Gets information about the specified network interface. /// /// /// The name of the resource group. @@ -47,6 +54,9 @@ public partial interface INetworkInterfacesOperations /// /// The name of the network interface. /// + /// + /// Expands referenced resources. + /// /// /// The headers that will be added to request. /// @@ -56,12 +66,15 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets information about the specified network interface. + /// Creates or updates a network interface. /// /// /// The name of the resource group. @@ -69,8 +82,9 @@ public partial interface INetworkInterfacesOperations /// /// The name of the network interface. /// - /// - /// Expands referenced resources. + /// + /// Parameters supplied to the create or update network interface + /// operation. /// /// /// The headers that will be added to request. @@ -87,19 +101,19 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a network interface. + /// Gets information about all network interfaces in a virtual machine + /// in a virtual machine scale set. /// /// /// The name of the resource group. /// - /// - /// The name of the network interface. + /// + /// The name of the virtual machine scale set. /// - /// - /// Parameters supplied to the create or update network interface - /// operation. + /// + /// The virtual machine index. /// /// /// The headers that will be added to request. @@ -116,19 +130,15 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListVirtualMachineScaleSetVMNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a network interface. + /// Gets all network interfaces in a virtual machine scale set. /// /// /// The name of the resource group. /// - /// - /// The name of the network interface. - /// - /// - /// Parameters supplied to the create or update network interface - /// operation. + /// + /// The name of the virtual machine scale set. /// /// /// The headers that will be added to request. @@ -145,10 +155,9 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListVirtualMachineScaleSetNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets information about all network interfaces in a virtual machine - /// in a virtual machine scale set. + /// Get the specified network interface in a virtual machine scale set. /// /// /// The name of the resource group. @@ -159,6 +168,12 @@ public partial interface INetworkInterfacesOperations /// /// The virtual machine index. /// + /// + /// The name of the network interface. + /// + /// + /// Expands referenced resources. + /// /// /// The headers that will be added to request. /// @@ -174,16 +189,10 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListVirtualMachineScaleSetVMNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetVirtualMachineScaleSetNetworkInterfaceWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all network interfaces in a virtual machine scale set. + /// Gets all network interfaces in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual machine scale set. - /// /// /// The headers that will be added to request. /// @@ -199,25 +208,13 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListVirtualMachineScaleSetNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get the specified network interface in a virtual machine scale set. + /// Gets all network interfaces in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the virtual machine scale set. - /// - /// - /// The virtual machine index. - /// - /// - /// The name of the network interface. - /// - /// - /// Expands referenced resources. - /// /// /// The headers that will be added to request. /// @@ -233,10 +230,16 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetVirtualMachineScaleSetNetworkInterfaceWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all network interfaces in a subscription. + /// Gets all route tables applied to a network interface. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// /// /// The headers that will be added to request. /// @@ -252,13 +255,16 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all network interfaces in a resource group. + /// Gets all network security groups applied to a network interface. /// /// /// The name of the resource group. /// + /// + /// The name of the network interface. + /// /// /// The headers that will be added to request. /// @@ -274,9 +280,9 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all route tables applied to a network interface. + /// Deletes the specified network interface. /// /// /// The name of the resource group. @@ -293,15 +299,12 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all route tables applied to a network interface. + /// Creates or updates a network interface. /// /// /// The name of the resource group. @@ -309,6 +312,10 @@ public partial interface INetworkInterfacesOperations /// /// The name of the network interface. /// + /// + /// Parameters supplied to the create or update network interface + /// operation. + /// /// /// The headers that will be added to request. /// @@ -324,9 +331,9 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginGetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all network security groups applied to a network interface. + /// Gets all route tables applied to a network interface. /// /// /// The name of the resource group. @@ -349,7 +356,7 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginGetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all network security groups applied to a network interface. /// @@ -374,7 +381,7 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets information about all network interfaces in a virtual machine /// in a virtual machine scale set. @@ -397,7 +404,7 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all network interfaces in a virtual machine scale set. /// @@ -419,7 +426,7 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListVirtualMachineScaleSetNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListVirtualMachineScaleSetNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all network interfaces in a subscription. /// @@ -441,7 +448,7 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all network interfaces in a resource group. /// @@ -463,6 +470,7 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkManagementClient.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkManagementClient.cs index c738bd4572e14..8e6aa29e5d86b 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkManagementClient.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkManagementClient.cs @@ -1,16 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// The Microsoft Azure Network management API provides a RESTful set of @@ -39,7 +46,7 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// Credentials needed for the client to connect to Azure. /// - Microsoft.Rest.ServiceClientCredentials Credentials { get; } + ServiceClientCredentials Credentials { get; } /// /// The subscription credentials which uniquely identify the Microsoft @@ -65,8 +72,8 @@ public partial interface INetworkManagementClient : System.IDisposable int? LongRunningOperationRetryTimeout { get; set; } /// - /// When set to true a unique x-ms-client-request-id value is - /// generated and included in each request. Default is true. + /// When set to true a unique x-ms-client-request-id value is generated + /// and included in each request. Default is true. /// bool? GenerateClientRequestId { get; set; } @@ -166,7 +173,7 @@ public partial interface INetworkManagementClient : System.IDisposable /// IVirtualNetworksOperations VirtualNetworks { get; } - /// + /// /// Checks whether a domain name in the cloudapp.net zone is available /// for use. /// @@ -183,7 +190,8 @@ public partial interface INetworkManagementClient : System.IDisposable /// /// The cancellation token. /// - System.Threading.Tasks.Task> CheckDnsNameAvailabilityWithHttpMessagesAsync(string location, string domainNameLabel = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CheckDnsNameAvailabilityWithHttpMessagesAsync(string location, string domainNameLabel = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkSecurityGroupsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkSecurityGroupsOperations.cs index d7b692ae5ecc0..195b7bab63b5f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkSecurityGroupsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkSecurityGroupsOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// NetworkSecurityGroupsOperations operations. @@ -37,9 +44,9 @@ public partial interface INetworkSecurityGroupsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified network security group. + /// Gets the specified network security group. /// /// /// The name of the resource group. @@ -47,6 +54,9 @@ public partial interface INetworkSecurityGroupsOperations /// /// The name of the network security group. /// + /// + /// Expands referenced resources. + /// /// /// The headers that will be added to request. /// @@ -56,12 +66,16 @@ public partial interface INetworkSecurityGroupsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the specified network security group. + /// Creates or updates a network security group in the specified + /// resource group. /// /// /// The name of the resource group. @@ -69,8 +83,9 @@ public partial interface INetworkSecurityGroupsOperations /// /// The name of the network security group. /// - /// - /// Expands referenced resources. + /// + /// Parameters supplied to the create or update network security group + /// operation. /// /// /// The headers that will be added to request. @@ -87,21 +102,10 @@ public partial interface INetworkSecurityGroupsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a network security group in the specified - /// resource group. + /// Gets all network security groups in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to the create or update network security group - /// operation. - /// /// /// The headers that will be added to request. /// @@ -117,21 +121,13 @@ public partial interface INetworkSecurityGroupsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a network security group in the specified - /// resource group. + /// Gets all network security groups in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to the create or update network security group - /// operation. - /// /// /// The headers that will be added to request. /// @@ -147,10 +143,16 @@ public partial interface INetworkSecurityGroupsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all network security groups in a subscription. + /// Deletes the specified network security group. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// /// /// The headers that will be added to request. /// @@ -160,19 +162,24 @@ public partial interface INetworkSecurityGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all network security groups in a resource group. + /// Creates or updates a network security group in the specified + /// resource group. /// /// /// The name of the resource group. /// + /// + /// The name of the network security group. + /// + /// + /// Parameters supplied to the create or update network security group + /// operation. + /// /// /// The headers that will be added to request. /// @@ -188,7 +195,7 @@ public partial interface INetworkSecurityGroupsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all network security groups in a subscription. /// @@ -210,7 +217,7 @@ public partial interface INetworkSecurityGroupsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all network security groups in a resource group. /// @@ -232,6 +239,7 @@ public partial interface INetworkSecurityGroupsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IPublicIpAddressesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IPublicIpAddressesOperations.cs index 07daf5cf2aec8..3e523929b7693 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IPublicIpAddressesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IPublicIpAddressesOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// PublicIPAddressesOperations operations. @@ -37,9 +44,9 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified public IP address. + /// Gets the specified public IP address in a specified resource group. /// /// /// The name of the resource group. @@ -47,6 +54,9 @@ public partial interface IPublicIPAddressesOperations /// /// The name of the subnet. /// + /// + /// Expands referenced resources. + /// /// /// The headers that will be added to request. /// @@ -56,21 +66,25 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the specified public IP address in a specified resource group. + /// Creates or updates a static or dynamic public IP address. /// /// /// The name of the resource group. /// /// - /// The name of the subnet. + /// The name of the public IP address. /// - /// - /// Expands referenced resources. + /// + /// Parameters supplied to the create or update public IP address + /// operation. /// /// /// The headers that will be added to request. @@ -87,20 +101,10 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a static or dynamic public IP address. + /// Gets all the public IP addresses in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - /// - /// Parameters supplied to the create or update public IP address - /// operation. - /// /// /// The headers that will be added to request. /// @@ -116,20 +120,13 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a static or dynamic public IP address. + /// Gets all public IP addresses in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the public IP address. - /// - /// - /// Parameters supplied to the create or update public IP address - /// operation. - /// /// /// The headers that will be added to request. /// @@ -145,10 +142,16 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all the public IP addresses in a subscription. + /// Deletes the specified public IP address. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the subnet. + /// /// /// The headers that will be added to request. /// @@ -158,19 +161,23 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all public IP addresses in a resource group. + /// Creates or updates a static or dynamic public IP address. /// /// /// The name of the resource group. /// + /// + /// The name of the public IP address. + /// + /// + /// Parameters supplied to the create or update public IP address + /// operation. + /// /// /// The headers that will be added to request. /// @@ -186,7 +193,7 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all the public IP addresses in a subscription. /// @@ -208,7 +215,7 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all public IP addresses in a resource group. /// @@ -230,6 +237,7 @@ public partial interface IPublicIPAddressesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRouteTablesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRouteTablesOperations.cs index 76ba58f4f0f71..764a86d571351 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRouteTablesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRouteTablesOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// RouteTablesOperations operations. @@ -37,9 +44,9 @@ public partial interface IRouteTablesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified route table. + /// Gets the specified route table. /// /// /// The name of the resource group. @@ -47,6 +54,9 @@ public partial interface IRouteTablesOperations /// /// The name of the route table. /// + /// + /// Expands referenced resources. + /// /// /// The headers that will be added to request. /// @@ -56,12 +66,15 @@ public partial interface IRouteTablesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the specified route table. + /// Create or updates a route table in a specified resource group. /// /// /// The name of the resource group. @@ -69,8 +82,8 @@ public partial interface IRouteTablesOperations /// /// The name of the route table. /// - /// - /// Expands referenced resources. + /// + /// Parameters supplied to the create or update route table operation. /// /// /// The headers that will be added to request. @@ -87,19 +100,13 @@ public partial interface IRouteTablesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or updates a route table in a specified resource group. + /// Gets all route tables in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the route table. - /// - /// - /// Parameters supplied to the create or update route table operation. - /// /// /// The headers that will be added to request. /// @@ -115,19 +122,10 @@ public partial interface IRouteTablesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or updates a route table in a specified resource group. + /// Gets all route tables in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// Parameters supplied to the create or update route table operation. - /// /// /// The headers that will be added to request. /// @@ -143,13 +141,16 @@ public partial interface IRouteTablesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all route tables in a resource group. + /// Deletes the specified route table. /// /// /// The name of the resource group. /// + /// + /// The name of the route table. + /// /// /// The headers that will be added to request. /// @@ -159,16 +160,22 @@ public partial interface IRouteTablesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all route tables in a subscription. + /// Create or updates a route table in a specified resource group. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// Parameters supplied to the create or update route table operation. + /// /// /// The headers that will be added to request. /// @@ -184,7 +191,7 @@ public partial interface IRouteTablesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all route tables in a resource group. /// @@ -206,7 +213,7 @@ public partial interface IRouteTablesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all route tables in a subscription. /// @@ -228,6 +235,7 @@ public partial interface IRouteTablesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRoutesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRoutesOperations.cs index 88c7c1afc1a09..70cf8855041a2 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRoutesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRoutesOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// RoutesOperations operations. @@ -40,9 +47,9 @@ public partial interface IRoutesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified route from a route table. + /// Gets the specified route from a route table. /// /// /// The name of the resource group. @@ -62,12 +69,15 @@ public partial interface IRoutesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the specified route from a route table. + /// Creates or updates a route in the specified route table. /// /// /// The name of the resource group. @@ -78,6 +88,9 @@ public partial interface IRoutesOperations /// /// The name of the route. /// + /// + /// Parameters supplied to the create or update route operation. + /// /// /// The headers that will be added to request. /// @@ -93,9 +106,9 @@ public partial interface IRoutesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a route in the specified route table. + /// Gets all routes in a route table. /// /// /// The name of the resource group. @@ -103,12 +116,6 @@ public partial interface IRoutesOperations /// /// The name of the route table. /// - /// - /// The name of the route. - /// - /// - /// Parameters supplied to the create or update route operation. - /// /// /// The headers that will be added to request. /// @@ -124,9 +131,9 @@ public partial interface IRoutesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a route in the specified route table. + /// Deletes the specified route from a route table. /// /// /// The name of the resource group. @@ -137,9 +144,6 @@ public partial interface IRoutesOperations /// /// The name of the route. /// - /// - /// Parameters supplied to the create or update route operation. - /// /// /// The headers that will be added to request. /// @@ -149,15 +153,12 @@ public partial interface IRoutesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all routes in a route table. + /// Creates or updates a route in the specified route table. /// /// /// The name of the resource group. @@ -165,6 +166,12 @@ public partial interface IRoutesOperations /// /// The name of the route table. /// + /// + /// The name of the route. + /// + /// + /// Parameters supplied to the create or update route operation. + /// /// /// The headers that will be added to request. /// @@ -180,7 +187,7 @@ public partial interface IRoutesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all routes in a route table. /// @@ -202,6 +209,7 @@ public partial interface IRoutesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISecurityRulesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISecurityRulesOperations.cs index c7fe04e31810f..617b6a7171dcb 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISecurityRulesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISecurityRulesOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// SecurityRulesOperations operations. @@ -40,9 +47,9 @@ public partial interface ISecurityRulesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified network security rule. + /// Get the specified network security rule. /// /// /// The name of the resource group. @@ -62,12 +69,16 @@ public partial interface ISecurityRulesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get the specified network security rule. + /// Creates or updates a security rule in the specified network + /// security group. /// /// /// The name of the resource group. @@ -78,6 +89,10 @@ public partial interface ISecurityRulesOperations /// /// The name of the security rule. /// + /// + /// Parameters supplied to the create or update network security rule + /// operation. + /// /// /// The headers that will be added to request. /// @@ -93,10 +108,9 @@ public partial interface ISecurityRulesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a security rule in the specified network - /// security group. + /// Gets all security rules in a network security group. /// /// /// The name of the resource group. @@ -104,13 +118,6 @@ public partial interface ISecurityRulesOperations /// /// The name of the network security group. /// - /// - /// The name of the security rule. - /// - /// - /// Parameters supplied to the create or update network security rule - /// operation. - /// /// /// The headers that will be added to request. /// @@ -126,10 +133,9 @@ public partial interface ISecurityRulesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a security rule in the specified network - /// security group. + /// Deletes the specified network security rule. /// /// /// The name of the resource group. @@ -140,10 +146,6 @@ public partial interface ISecurityRulesOperations /// /// The name of the security rule. /// - /// - /// Parameters supplied to the create or update network security rule - /// operation. - /// /// /// The headers that will be added to request. /// @@ -153,15 +155,13 @@ public partial interface ISecurityRulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all security rules in a network security group. + /// Creates or updates a security rule in the specified network + /// security group. /// /// /// The name of the resource group. @@ -169,6 +169,13 @@ public partial interface ISecurityRulesOperations /// /// The name of the network security group. /// + /// + /// The name of the security rule. + /// + /// + /// Parameters supplied to the create or update network security rule + /// operation. + /// /// /// The headers that will be added to request. /// @@ -184,7 +191,7 @@ public partial interface ISecurityRulesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all security rules in a network security group. /// @@ -206,6 +213,7 @@ public partial interface ISecurityRulesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISubnetsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISubnetsOperations.cs index 34a0739ee14c8..ff6225b5e2265 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISubnetsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISubnetsOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// SubnetsOperations operations. @@ -40,9 +47,9 @@ public partial interface ISubnetsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified subnet. + /// Gets the specified subnet by virtual network and resource group. /// /// /// The name of the resource group. @@ -53,6 +60,9 @@ public partial interface ISubnetsOperations /// /// The name of the subnet. /// + /// + /// Expands referenced resources. + /// /// /// The headers that will be added to request. /// @@ -62,12 +72,15 @@ public partial interface ISubnetsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the specified subnet by virtual network and resource group. + /// Creates or updates a subnet in the specified virtual network. /// /// /// The name of the resource group. @@ -78,8 +91,8 @@ public partial interface ISubnetsOperations /// /// The name of the subnet. /// - /// - /// Expands referenced resources. + /// + /// Parameters supplied to the create or update subnet operation. /// /// /// The headers that will be added to request. @@ -96,9 +109,9 @@ public partial interface ISubnetsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a subnet in the specified virtual network. + /// Gets all subnets in a virtual network. /// /// /// The name of the resource group. @@ -106,12 +119,6 @@ public partial interface ISubnetsOperations /// /// The name of the virtual network. /// - /// - /// The name of the subnet. - /// - /// - /// Parameters supplied to the create or update subnet operation. - /// /// /// The headers that will be added to request. /// @@ -127,9 +134,9 @@ public partial interface ISubnetsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a subnet in the specified virtual network. + /// Deletes the specified subnet. /// /// /// The name of the resource group. @@ -140,9 +147,6 @@ public partial interface ISubnetsOperations /// /// The name of the subnet. /// - /// - /// Parameters supplied to the create or update subnet operation. - /// /// /// The headers that will be added to request. /// @@ -152,15 +156,12 @@ public partial interface ISubnetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all subnets in a virtual network. + /// Creates or updates a subnet in the specified virtual network. /// /// /// The name of the resource group. @@ -168,6 +169,12 @@ public partial interface ISubnetsOperations /// /// The name of the virtual network. /// + /// + /// The name of the subnet. + /// + /// + /// Parameters supplied to the create or update subnet operation. + /// /// /// The headers that will be added to request. /// @@ -183,7 +190,7 @@ public partial interface ISubnetsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all subnets in a virtual network. /// @@ -205,6 +212,7 @@ public partial interface ISubnetsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IUsagesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IUsagesOperations.cs index c0a72fa8723f2..6a6c2b90fac2f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IUsagesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IUsagesOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// UsagesOperations operations. @@ -37,7 +44,7 @@ public partial interface IUsagesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists compute usages for a subscription. /// @@ -59,6 +66,7 @@ public partial interface IUsagesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewayConnectionsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewayConnectionsOperations.cs index 34b33f9000470..2547fc611c78e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewayConnectionsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewayConnectionsOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// VirtualNetworkGatewayConnectionsOperations operations. @@ -27,8 +34,8 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// The name of the virtual network gateway connection. /// /// - /// Parameters supplied to the create or update virtual network - /// gateway connection operation. + /// Parameters supplied to the create or update virtual network gateway + /// connection operation. /// /// /// The headers that will be added to request. @@ -45,10 +52,10 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a virtual network gateway connection in the - /// specified resource group. + /// Gets the specified virtual network gateway connection by resource + /// group. /// /// /// The name of the resource group. @@ -56,10 +63,6 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The name of the virtual network gateway connection. /// - /// - /// Parameters supplied to the create or update virtual network - /// gateway connection operation. - /// /// /// The headers that will be added to request. /// @@ -75,10 +78,9 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the specified virtual network gateway connection by resource - /// group. + /// Deletes the specified virtual network Gateway connection. /// /// /// The name of the resource group. @@ -95,21 +97,25 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified virtual network Gateway connection. + /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the + /// virtual network gateway connection shared key for passed virtual + /// network gateway connection in the specified resource group through + /// Network resource provider. /// /// /// The name of the resource group. /// /// - /// The name of the virtual network gateway connection. + /// The virtual network gateway connection name. + /// + /// + /// Parameters supplied to the Begin Set Virtual Network Gateway + /// connection Shared key operation throughNetwork resource provider. /// /// /// The headers that will be added to request. @@ -120,18 +126,23 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> SetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified virtual network Gateway connection. + /// The Get VirtualNetworkGatewayConnectionSharedKey operation + /// retrieves information about the specified virtual network gateway + /// connection shared key through Network resource provider. /// /// /// The name of the resource group. /// /// - /// The name of the virtual network gateway connection. + /// The virtual network gateway connection shared key name. /// /// /// The headers that will be added to request. @@ -142,26 +153,20 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets - /// the virtual network gateway connection shared key for passed - /// virtual network gateway connection in the specified resource - /// group through Network resource provider. + /// The List VirtualNetworkGatewayConnections operation retrieves all + /// the virtual network gateways connections created. /// /// /// The name of the resource group. /// - /// - /// The virtual network gateway connection name. - /// - /// - /// Parameters supplied to the Begin Set Virtual Network Gateway - /// connection Shared key operation throughNetwork resource provider. - /// /// /// The headers that will be added to request. /// @@ -177,22 +182,22 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> SetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets + /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets /// the virtual network gateway connection shared key for passed - /// virtual network gateway connection in the specified resource - /// group through Network resource provider. + /// virtual network gateway connection in the specified resource group + /// through Network resource provider. /// /// /// The name of the resource group. /// /// - /// The virtual network gateway connection name. + /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the Begin Set Virtual Network Gateway - /// connection Shared key operation throughNetwork resource provider. + /// Parameters supplied to the begin reset virtual network gateway + /// connection shared key operation through network resource provider. /// /// /// The headers that will be added to request. @@ -209,17 +214,20 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginSetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> ResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Get VirtualNetworkGatewayConnectionSharedKey operation - /// retrieves information about the specified virtual network gateway - /// connection shared key through Network resource provider. + /// Creates or updates a virtual network gateway connection in the + /// specified resource group. /// /// /// The name of the resource group. /// /// - /// The virtual network gateway connection shared key name. + /// The name of the virtual network gateway connection. + /// + /// + /// Parameters supplied to the create or update virtual network gateway + /// connection operation. /// /// /// The headers that will be added to request. @@ -236,14 +244,16 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List VirtualNetworkGatewayConnections operation retrieves all - /// the virtual network gateways connections created. + /// Deletes the specified virtual network Gateway connection. /// /// /// The name of the resource group. /// + /// + /// The name of the virtual network gateway connection. + /// /// /// The headers that will be added to request. /// @@ -253,28 +263,25 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets - /// the virtual network gateway connection shared key for passed - /// virtual network gateway connection in the specified resource - /// group through Network resource provider. + /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the + /// virtual network gateway connection shared key for passed virtual + /// network gateway connection in the specified resource group through + /// Network resource provider. /// /// /// The name of the resource group. /// /// - /// The virtual network gateway connection reset shared key Name. + /// The virtual network gateway connection name. /// /// - /// Parameters supplied to the begin reset virtual network gateway - /// connection shared key operation through network resource provider. + /// Parameters supplied to the Begin Set Virtual Network Gateway + /// connection Shared key operation throughNetwork resource provider. /// /// /// The headers that will be added to request. @@ -291,12 +298,12 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> ResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginSetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets /// the virtual network gateway connection shared key for passed - /// virtual network gateway connection in the specified resource - /// group through Network resource provider. + /// virtual network gateway connection in the specified resource group + /// through Network resource provider. /// /// /// The name of the resource group. @@ -323,7 +330,7 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The List VirtualNetworkGatewayConnections operation retrieves all /// the virtual network gateways connections created. @@ -346,6 +353,7 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs index 72d453d3a8daa..f529897ad1509 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// VirtualNetworkGatewaysOperations operations. @@ -45,10 +52,9 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a virtual network gateway in the specified - /// resource group. + /// Gets the specified virtual network gateway by resource group. /// /// /// The name of the resource group. @@ -56,10 +62,6 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The name of the virtual network gateway. /// - /// - /// Parameters supplied to create or update virtual network gateway - /// operation. - /// /// /// The headers that will be added to request. /// @@ -75,9 +77,9 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the specified virtual network gateway by resource group. + /// Deletes the specified virtual network gateway. /// /// /// The name of the resource group. @@ -94,22 +96,16 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified virtual network gateway. + /// Gets all virtual network gateways by resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the virtual network gateway. - /// /// /// The headers that will be added to request. /// @@ -119,12 +115,16 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified virtual network gateway. + /// Resets the primary of the virtual network gateway in the specified + /// resource group. /// /// /// The name of the resource group. @@ -132,6 +132,10 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The name of the virtual network gateway. /// + /// + /// Virtual network gateway vip address supplied to the begin reset of + /// the active-active feature enabled gateway. + /// /// /// The headers that will be added to request. /// @@ -141,16 +145,27 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> ResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all virtual network gateways by resource group. + /// Generates VPN client package for P2S client of the virtual network + /// gateway in the specified resource group. /// /// /// The name of the resource group. /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Parameters supplied to the generate virtual network gateway VPN + /// client package operation. + /// /// /// The headers that will be added to request. /// @@ -166,9 +181,9 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GeneratevpnclientpackageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Resets the primary of the virtual network gateway in the specified + /// Creates or updates a virtual network gateway in the specified /// resource group. /// /// @@ -177,9 +192,9 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The name of the virtual network gateway. /// - /// - /// Virtual network gateway vip address supplied to the begin reset of - /// the active-active feature enabled gateway. + /// + /// Parameters supplied to create or update virtual network gateway + /// operation. /// /// /// The headers that will be added to request. @@ -196,10 +211,9 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> ResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Resets the primary of the virtual network gateway in the specified - /// resource group. + /// Deletes the specified virtual network gateway. /// /// /// The name of the resource group. @@ -207,10 +221,6 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The name of the virtual network gateway. /// - /// - /// Virtual network gateway vip address supplied to the begin reset of - /// the active-active feature enabled gateway. - /// /// /// The headers that will be added to request. /// @@ -220,16 +230,13 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Generates VPN client package for P2S client of the virtual network - /// gateway in the specified resource group. + /// Resets the primary of the virtual network gateway in the specified + /// resource group. /// /// /// The name of the resource group. @@ -237,9 +244,9 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The name of the virtual network gateway. /// - /// - /// Parameters supplied to the generate virtual network gateway VPN - /// client package operation. + /// + /// Virtual network gateway vip address supplied to the begin reset of + /// the active-active feature enabled gateway. /// /// /// The headers that will be added to request. @@ -256,7 +263,7 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GeneratevpnclientpackageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all virtual network gateways by resource group. /// @@ -278,6 +285,7 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkPeeringsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkPeeringsOperations.cs index f9a184cbb52c6..181953c954e3f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkPeeringsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkPeeringsOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// VirtualNetworkPeeringsOperations operations. @@ -40,9 +47,9 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified virtual network peering. + /// Gets the specified virtual network peering. /// /// /// The name of the resource group. @@ -62,12 +69,15 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the specified virtual network peering. + /// Creates or updates a peering in the specified virtual network. /// /// /// The name of the resource group. @@ -76,7 +86,11 @@ public partial interface IVirtualNetworkPeeringsOperations /// The name of the virtual network. /// /// - /// The name of the virtual network peering. + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update virtual network peering + /// operation. /// /// /// The headers that will be added to request. @@ -93,9 +107,9 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a peering in the specified virtual network. + /// Gets all virtual network peerings in a virtual network. /// /// /// The name of the resource group. @@ -103,13 +117,6 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// The name of the virtual network. /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update virtual network - /// peering operation. - /// /// /// The headers that will be added to request. /// @@ -125,9 +132,9 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a peering in the specified virtual network. + /// Deletes the specified virtual network peering. /// /// /// The name of the resource group. @@ -136,11 +143,7 @@ public partial interface IVirtualNetworkPeeringsOperations /// The name of the virtual network. /// /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update virtual network - /// peering operation. + /// The name of the virtual network peering. /// /// /// The headers that will be added to request. @@ -151,15 +154,12 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all virtual network peerings in a virtual network. + /// Creates or updates a peering in the specified virtual network. /// /// /// The name of the resource group. @@ -167,6 +167,13 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// The name of the virtual network. /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update virtual network peering + /// operation. + /// /// /// The headers that will be added to request. /// @@ -182,7 +189,7 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all virtual network peerings in a virtual network. /// @@ -204,6 +211,7 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworksOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworksOperations.cs index 972fe2d1615ac..acadbcdad6df9 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworksOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworksOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// VirtualNetworksOperations operations. @@ -37,9 +44,9 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified virtual network. + /// Gets the specified virtual network by resource group. /// /// /// The name of the resource group. @@ -47,6 +54,9 @@ public partial interface IVirtualNetworksOperations /// /// The name of the virtual network. /// + /// + /// Expands referenced resources. + /// /// /// The headers that will be added to request. /// @@ -56,12 +66,16 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the specified virtual network by resource group. + /// Creates or updates a virtual network in the specified resource + /// group. /// /// /// The name of the resource group. @@ -69,8 +83,9 @@ public partial interface IVirtualNetworksOperations /// /// The name of the virtual network. /// - /// - /// Expands referenced resources. + /// + /// Parameters supplied to the create or update virtual network + /// operation /// /// /// The headers that will be added to request. @@ -87,21 +102,10 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a virtual network in the specified resource - /// group. + /// Gets all virtual networks in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to the create or update virtual network - /// operation - /// /// /// The headers that will be added to request. /// @@ -117,21 +121,13 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a virtual network in the specified resource - /// group. + /// Gets all virtual networks in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to the create or update virtual network - /// operation - /// /// /// The headers that will be added to request. /// @@ -147,10 +143,19 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all virtual networks in a subscription. + /// Checks whether a private IP address is available for use. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The private IP address to be verified. + /// /// /// The headers that will be added to request. /// @@ -166,13 +171,16 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CheckIPAddressAvailabilityWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string ipAddress = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all virtual networks in a resource group. + /// Deletes the specified virtual network. /// /// /// The name of the resource group. /// + /// + /// The name of the virtual network. + /// /// /// The headers that will be added to request. /// @@ -182,15 +190,13 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Checks whether a private IP address is available for use. + /// Creates or updates a virtual network in the specified resource + /// group. /// /// /// The name of the resource group. @@ -198,8 +204,9 @@ public partial interface IVirtualNetworksOperations /// /// The name of the virtual network. /// - /// - /// The private IP address to be verified. + /// + /// Parameters supplied to the create or update virtual network + /// operation /// /// /// The headers that will be added to request. @@ -216,7 +223,7 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CheckIPAddressAvailabilityWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string ipAddress = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all virtual networks in a subscription. /// @@ -238,7 +245,7 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all virtual networks in a resource group. /// @@ -260,6 +267,7 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperations.cs index 233adbc60aa12..4f252fee36b93 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// LoadBalancersOperations operations. /// - internal partial class LoadBalancersOperations : Microsoft.Rest.IServiceOperations, ILoadBalancersOperations + internal partial class LoadBalancersOperations : IServiceOperations, ILoadBalancersOperations { /// /// Initializes a new instance of the LoadBalancersOperations class. @@ -29,11 +38,11 @@ internal partial class LoadBalancersOperations : Microsoft.Rest.IServiceOperatio /// internal LoadBalancersOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -56,16 +65,16 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, loadBalancerName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// Deletes the specified load balancer. + /// Gets the specified load balancer. /// /// /// The name of the resource group. @@ -73,83 +82,97 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The name of the load balancer. /// + /// + /// Expands referenced resources. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (loadBalancerName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); + throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -166,43 +189,51 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + 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; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,22 +243,40 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets the specified load balancer. + /// Creates or updates a load balancer. /// /// /// The name of the resource group. @@ -235,94 +284,99 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The name of the load balancer. /// - /// - /// Expands referenced resources. + /// + /// Parameters supplied to the create or update load balancer operation. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, loadBalancerName, parameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all the load balancers in a subscription. + /// + /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (loadBalancerName == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); - } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("loadBalancerName", loadBalancerName); - tracingParameters.Add("expand", expand); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); - } - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -339,35 +393,35 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -375,15 +429,15 @@ internal LoadBalancersOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -393,7 +447,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -406,7 +460,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -415,141 +469,99 @@ internal LoadBalancersOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Creates or updates a load balancer. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// Parameters supplied to the create or update load balancer operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, loadBalancerName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// Creates or updates a load balancer. + /// Gets all the load balancers in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the load balancer. - /// - /// - /// Parameters supplied to the create or update load balancer operation. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (loadBalancerName == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "loadBalancerName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (parameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); - } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("loadBalancerName", loadBalancerName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -565,42 +577,36 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -608,15 +614,15 @@ internal LoadBalancersOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -626,7 +632,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -634,30 +640,12 @@ internal LoadBalancersOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -666,87 +654,105 @@ internal LoadBalancersOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all the load balancers in a subscription. + /// Deletes the specified load balancer. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when 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 System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.ApiVersion == null) + if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.SubscriptionId == null) + if (loadBalancerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + } + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -763,51 +769,43 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (Newtonsoft.Json.JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -817,118 +815,120 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all the load balancers in a resource group. + /// Creates or updates a load balancer. /// /// /// The name of the resource group. /// + /// + /// The name of the load balancer. + /// + /// + /// Parameters supplied to the create or update load balancer operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (loadBalancerName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); } - if (this.Client.SubscriptionId == null) + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("loadBalancerName", loadBalancerName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -944,36 +944,42 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 201 && (int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -981,15 +987,15 @@ internal LoadBalancersOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -999,7 +1005,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1007,12 +1013,30 @@ internal LoadBalancersOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1021,12 +1045,12 @@ internal LoadBalancersOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1043,60 +1067,63 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1113,35 +1140,35 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1149,15 +1176,15 @@ internal LoadBalancersOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1167,7 +1194,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1180,7 +1207,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1189,12 +1216,12 @@ internal LoadBalancersOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1211,60 +1238,63 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1281,35 +1311,35 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1317,15 +1347,15 @@ internal LoadBalancersOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1335,7 +1365,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1348,7 +1378,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1357,15 +1387,16 @@ internal LoadBalancersOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperationsExtensions.cs index 7b9cce404a305..9377b94e21d4f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for LoadBalancersOperations. @@ -31,7 +35,7 @@ public static partial class LoadBalancersOperationsExtensions /// public static void Delete(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).DeleteAsync(resourceGroupName, loadBalancerName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).DeleteAsync(resourceGroupName, loadBalancerName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -49,48 +53,11 @@ public static void Delete(this ILoadBalancersOperations operations, string resou /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, CancellationToken cancellationToken = default(CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false); } - /// - /// Deletes the specified load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - public static void BeginDelete(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName) - { - System.Threading.Tasks.Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).BeginDeleteAsync(resourceGroupName, loadBalancerName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified load balancer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false); - } - /// /// Gets the specified load balancer. /// @@ -108,7 +75,7 @@ public static void BeginDelete(this ILoadBalancersOperations operations, string /// public static LoadBalancer Get(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, string expand = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).GetAsync(resourceGroupName, loadBalancerName, expand), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).GetAsync(resourceGroupName, loadBalancerName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -129,7 +96,7 @@ public static void BeginDelete(this ILoadBalancersOperations operations, string /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, loadBalancerName, expand, null, cancellationToken).ConfigureAwait(false)) { @@ -154,7 +121,7 @@ public static void BeginDelete(this ILoadBalancersOperations operations, string /// public static LoadBalancer CreateOrUpdate(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).CreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).CreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -175,7 +142,7 @@ public static LoadBalancer CreateOrUpdate(this ILoadBalancersOperations operatio /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -184,27 +151,35 @@ public static LoadBalancer CreateOrUpdate(this ILoadBalancersOperations operatio } /// - /// Creates or updates a load balancer. + /// Gets all the load balancers in a subscription. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. + public static IPage ListAll(this ILoadBalancersOperations operations) + { + return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Gets all the load balancers in a subscription. + /// + /// + /// The operations group for this extension method. /// - /// - /// Parameters supplied to the create or update load balancer operation. + /// + /// The cancellation token. /// - public static LoadBalancer BeginCreateOrUpdate(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters) + public static async Task> ListAllAsync(this ILoadBalancersOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Creates or updates a load balancer. + /// Gets all the load balancers in a resource group. /// /// /// The operations group for this extension method. @@ -212,53 +187,70 @@ public static LoadBalancer BeginCreateOrUpdate(this ILoadBalancersOperations ope /// /// The name of the resource group. /// - /// - /// The name of the load balancer. + public static IPage List(this ILoadBalancersOperations operations, string resourceGroupName) + { + return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Gets all the load balancers in a resource group. + /// + /// + /// The operations group for this extension method. /// - /// - /// Parameters supplied to the create or update load balancer operation. + /// + /// The name of the resource group. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this ILoadBalancersOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets all the load balancers in a subscription. + /// Deletes the specified load balancer. /// /// /// The operations group for this extension method. /// - public static Microsoft.Rest.Azure.IPage ListAll(this ILoadBalancersOperations operations) + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + public static void BeginDelete(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).ListAllAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).BeginDeleteAsync(resourceGroupName, loadBalancerName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all the load balancers in a subscription. + /// Deletes the specified load balancer. /// /// /// The operations group for this extension method. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// /// /// The cancellation token. /// - public static async Task> ListAllAsync(this ILoadBalancersOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginDeleteAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false); } /// - /// Gets all the load balancers in a resource group. + /// Creates or updates a load balancer. /// /// /// The operations group for this extension method. @@ -266,13 +258,19 @@ public static Microsoft.Rest.Azure.IPage ListAll(this ILoadBalance /// /// The name of the resource group. /// - public static Microsoft.Rest.Azure.IPage List(this ILoadBalancersOperations operations, string resourceGroupName) + /// + /// The name of the load balancer. + /// + /// + /// Parameters supplied to the create or update load balancer operation. + /// + public static LoadBalancer BeginCreateOrUpdate(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all the load balancers in a resource group. + /// Creates or updates a load balancer. /// /// /// The operations group for this extension method. @@ -280,12 +278,18 @@ public static Microsoft.Rest.Azure.IPage List(this ILoadBalancersO /// /// The name of the resource group. /// + /// + /// The name of the load balancer. + /// + /// + /// Parameters supplied to the create or update load balancer operation. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this ILoadBalancersOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -300,9 +304,9 @@ public static Microsoft.Rest.Azure.IPage List(this ILoadBalancersO /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListAllNext(this ILoadBalancersOperations operations, string nextPageLink) + public static IPage ListAllNext(this ILoadBalancersOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).ListAllNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).ListAllNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -317,7 +321,7 @@ public static Microsoft.Rest.Azure.IPage ListAllNext(this ILoadBal /// /// The cancellation token. /// - public static async Task> ListAllNextAsync(this ILoadBalancersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAllNextAsync(this ILoadBalancersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -334,9 +338,9 @@ public static Microsoft.Rest.Azure.IPage ListAllNext(this ILoadBal /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this ILoadBalancersOperations operations, string nextPageLink) + public static IPage ListNext(this ILoadBalancersOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -351,7 +355,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this ILoadBalanc /// /// The cancellation token. /// - public static async Task> ListNextAsync(this ILoadBalancersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this ILoadBalancersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -361,3 +365,4 @@ public static Microsoft.Rest.Azure.IPage ListNext(this ILoadBalanc } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperations.cs index b0b652cab72ae..4710309e0eb36 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// LocalNetworkGatewaysOperations operations. /// - internal partial class LocalNetworkGatewaysOperations : Microsoft.Rest.IServiceOperations, ILocalNetworkGatewaysOperations + internal partial class LocalNetworkGatewaysOperations : IServiceOperations, ILocalNetworkGatewaysOperations { /// /// Initializes a new instance of the LocalNetworkGatewaysOperations class. @@ -29,11 +38,11 @@ internal partial class LocalNetworkGatewaysOperations : Microsoft.Rest.IServiceO /// internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -60,18 +69,18 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, localNetworkGatewayName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// Creates or updates a local network gateway in the specified resource group. + /// Gets the specified local network gateway in a resource group. /// /// /// The name of the resource group. @@ -79,99 +88,89 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The name of the local network gateway. /// - /// - /// Parameters supplied to the create or update local network gateway - /// operation. - /// /// /// Headers that will be added to request. /// /// /// The cancellation 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 System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (localNetworkGatewayName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "localNetworkGatewayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "localNetworkGatewayName"); } - if (parameters == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (parameters != null) + if (Client.SubscriptionId == null) { - parameters.Validate(); - } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{localNetworkGatewayName}", System.Uri.EscapeDataString(localNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -187,42 +186,36 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -230,15 +223,15 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -248,7 +241,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -256,30 +249,12 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -288,18 +263,18 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets the specified local network gateway in a resource group. + /// Deletes the specified local network gateway. /// /// /// The name of the resource group. @@ -308,85 +283,102 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// The name of the local network gateway. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + resourceGroupName, localNetworkGatewayName, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// Gets all the local network gateways in a resource group. + /// + /// + /// The name of the resource group. + /// + /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (localNetworkGatewayName == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "localNetworkGatewayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.ApiVersion == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{localNetworkGatewayName}", System.Uri.EscapeDataString(localNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -403,35 +395,35 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -439,15 +431,15 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -457,7 +449,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -470,7 +462,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -479,18 +471,18 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Deletes the specified local network gateway. + /// Creates or updates a local network gateway in the specified resource group. /// /// /// The name of the resource group. @@ -498,28 +490,9 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The name of the local network gateway. /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( - resourceGroupName, localNetworkGatewayName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - - /// - /// Deletes the specified local network gateway. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the local network gateway. + /// + /// Parameters supplied to the create or update local network gateway + /// operation. /// /// /// Headers that will be added to request. @@ -527,77 +500,92 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (localNetworkGatewayName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "localNetworkGatewayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "localNetworkGatewayName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{localNetworkGatewayName}", System.Uri.EscapeDataString(localNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -613,44 +601,58 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 201 && (int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + 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; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -660,100 +662,145 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all the local network gateways in a resource group. + /// Deletes the specified local network gateway. /// /// /// The name of the resource group. /// + /// + /// The name of the local network gateway. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (localNetworkGatewayName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "localNetworkGatewayName"); } - if (this.Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{localNetworkGatewayName}", System.Uri.EscapeDataString(localNetworkGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -770,51 +817,43 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (Newtonsoft.Json.JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -824,34 +863,16 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -868,60 +889,63 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -938,35 +962,35 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -974,15 +998,15 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -992,7 +1016,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1005,7 +1029,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1014,15 +1038,16 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperationsExtensions.cs index f78d11b3f32bf..2d9a7a7744d4b 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for LocalNetworkGatewaysOperations. @@ -35,7 +39,7 @@ public static partial class LocalNetworkGatewaysOperationsExtensions /// public static LocalNetworkGateway CreateOrUpdate(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).CreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).CreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -57,7 +61,7 @@ public static LocalNetworkGateway CreateOrUpdate(this ILocalNetworkGatewaysOpera /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -66,7 +70,7 @@ public static LocalNetworkGateway CreateOrUpdate(this ILocalNetworkGatewaysOpera } /// - /// Creates or updates a local network gateway in the specified resource group. + /// Gets the specified local network gateway in a resource group. /// /// /// The operations group for this extension method. @@ -77,17 +81,13 @@ public static LocalNetworkGateway CreateOrUpdate(this ILocalNetworkGatewaysOpera /// /// The name of the local network gateway. /// - /// - /// Parameters supplied to the create or update local network gateway - /// operation. - /// - public static LocalNetworkGateway BeginCreateOrUpdate(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters) + public static LocalNetworkGateway Get(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).GetAsync(resourceGroupName, localNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Creates or updates a local network gateway in the specified resource group. + /// Gets the specified local network gateway in a resource group. /// /// /// The operations group for this extension method. @@ -98,23 +98,19 @@ public static LocalNetworkGateway BeginCreateOrUpdate(this ILocalNetworkGateways /// /// The name of the local network gateway. /// - /// - /// Parameters supplied to the create or update local network gateway - /// operation. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the specified local network gateway in a resource group. + /// Deletes the specified local network gateway. /// /// /// The operations group for this extension method. @@ -125,13 +121,13 @@ public static LocalNetworkGateway BeginCreateOrUpdate(this ILocalNetworkGateways /// /// The name of the local network gateway. /// - public static LocalNetworkGateway Get(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) + public static void Delete(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).GetAsync(resourceGroupName, localNetworkGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).DeleteAsync(resourceGroupName, localNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets the specified local network gateway in a resource group. + /// Deletes the specified local network gateway. /// /// /// The operations group for this extension method. @@ -145,16 +141,13 @@ public static LocalNetworkGateway Get(this ILocalNetworkGatewaysOperations opera /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.DeleteWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// Deletes the specified local network gateway. + /// Gets all the local network gateways in a resource group. /// /// /// The operations group for this extension method. @@ -162,16 +155,13 @@ public static LocalNetworkGateway Get(this ILocalNetworkGatewaysOperations opera /// /// The name of the resource group. /// - /// - /// The name of the local network gateway. - /// - public static void Delete(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) + public static IPage List(this ILocalNetworkGatewaysOperations operations, string resourceGroupName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).DeleteAsync(resourceGroupName, localNetworkGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Deletes the specified local network gateway. + /// Gets all the local network gateways in a resource group. /// /// /// The operations group for this extension method. @@ -179,19 +169,19 @@ public static void Delete(this ILocalNetworkGatewaysOperations operations, strin /// /// The name of the resource group. /// - /// - /// The name of the local network gateway. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Deletes the specified local network gateway. + /// Creates or updates a local network gateway in the specified resource group. /// /// /// The operations group for this extension method. @@ -202,13 +192,17 @@ public static void Delete(this ILocalNetworkGatewaysOperations operations, strin /// /// The name of the local network gateway. /// - public static void BeginDelete(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) + /// + /// Parameters supplied to the create or update local network gateway + /// operation. + /// + public static LocalNetworkGateway BeginCreateOrUpdate(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).BeginDeleteAsync(resourceGroupName, localNetworkGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Deletes the specified local network gateway. + /// Creates or updates a local network gateway in the specified resource group. /// /// /// The operations group for this extension method. @@ -219,16 +213,23 @@ public static void BeginDelete(this ILocalNetworkGatewaysOperations operations, /// /// The name of the local network gateway. /// + /// + /// Parameters supplied to the create or update local network gateway + /// operation. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Gets all the local network gateways in a resource group. + /// Deletes the specified local network gateway. /// /// /// The operations group for this extension method. @@ -236,13 +237,16 @@ public static void BeginDelete(this ILocalNetworkGatewaysOperations operations, /// /// The name of the resource group. /// - public static Microsoft.Rest.Azure.IPage List(this ILocalNetworkGatewaysOperations operations, string resourceGroupName) + /// + /// The name of the local network gateway. + /// + public static void BeginDelete(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).BeginDeleteAsync(resourceGroupName, localNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all the local network gateways in a resource group. + /// Deletes the specified local network gateway. /// /// /// The operations group for this extension method. @@ -250,15 +254,15 @@ public static Microsoft.Rest.Azure.IPage List(this ILocalNe /// /// The name of the resource group. /// + /// + /// The name of the local network gateway. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginDeleteAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false); } /// @@ -270,9 +274,9 @@ public static Microsoft.Rest.Azure.IPage List(this ILocalNe /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this ILocalNetworkGatewaysOperations operations, string nextPageLink) + public static IPage ListNext(this ILocalNetworkGatewaysOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -287,7 +291,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this ILoc /// /// The cancellation token. /// - public static async Task> ListNextAsync(this ILocalNetworkGatewaysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this ILocalNetworkGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -297,3 +301,4 @@ public static Microsoft.Rest.Azure.IPage ListNext(this ILoc } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AddressSpace.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AddressSpace.cs index 1ea669916b8fc..5916d2d769c2d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AddressSpace.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AddressSpace.cs @@ -1,18 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// - /// AddressSpace contains an array of IP address ranges that can be used - /// by subnets of the virtual network. + /// AddressSpace contains an array of IP address ranges that can be used by + /// subnets of the virtual network. /// public partial class AddressSpace { @@ -24,9 +30,9 @@ public AddressSpace() { } /// /// Initializes a new instance of the AddressSpace class. /// - /// A list of address blocks reserved - /// for this virtual network in CIDR notation. - public AddressSpace(System.Collections.Generic.IList addressPrefixes = default(System.Collections.Generic.IList)) + /// A list of address blocks reserved for + /// this virtual network in CIDR notation. + public AddressSpace(IList addressPrefixes = default(IList)) { AddressPrefixes = addressPrefixes; } @@ -35,8 +41,9 @@ public AddressSpace() { } /// Gets or sets a list of address blocks reserved for this virtual /// network in CIDR notation. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefixes")] - public System.Collections.Generic.IList AddressPrefixes { get; set; } + [JsonProperty(PropertyName = "addressPrefixes")] + public IList AddressPrefixes { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGateway.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGateway.cs index 409753665fc41..78410098a118a 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGateway.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGateway.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Application gateway resource /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class ApplicationGateway : Resource { /// @@ -32,18 +40,18 @@ public ApplicationGateway() { } /// SKU of the application gateway resource. /// SSL policy of the application gateway /// resource. - /// Operational state of the - /// application gateway resource. Possible values are: 'Stopped', - /// 'Started', 'Running', and 'Stopping'. Possible values include: - /// 'Stopped', 'Starting', 'Running', 'Stopping' + /// Operational state of the application + /// gateway resource. Possible values are: 'Stopped', 'Started', + /// 'Running', and 'Stopping'. Possible values include: 'Stopped', + /// 'Starting', 'Running', 'Stopping' /// Subnets of application the /// gateway resource. /// Authentication /// certificates of the application gateway resource. /// SSL certificates of the application /// gateway resource. - /// Frontend IP addresses of - /// the application gateway resource. + /// Frontend IP addresses of the + /// application gateway resource. /// Frontend ports of the application /// gateway resource. /// Probes of the application gateway @@ -67,7 +75,7 @@ public ApplicationGateway() { } /// 'Deleting', and 'Failed'. /// A unique read-only string that changes whenever /// the resource is updated. - public ApplicationGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ApplicationGatewaySku sku = default(ApplicationGatewaySku), ApplicationGatewaySslPolicy sslPolicy = default(ApplicationGatewaySslPolicy), string operationalState = default(string), System.Collections.Generic.IList gatewayIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList authenticationCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList sslCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList frontendIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList frontendPorts = default(System.Collections.Generic.IList), System.Collections.Generic.IList probes = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendHttpSettingsCollection = default(System.Collections.Generic.IList), System.Collections.Generic.IList httpListeners = default(System.Collections.Generic.IList), System.Collections.Generic.IList urlPathMaps = default(System.Collections.Generic.IList), System.Collections.Generic.IList requestRoutingRules = default(System.Collections.Generic.IList), ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration = default(ApplicationGatewayWebApplicationFirewallConfiguration), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + public ApplicationGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ApplicationGatewaySku sku = default(ApplicationGatewaySku), ApplicationGatewaySslPolicy sslPolicy = default(ApplicationGatewaySslPolicy), string operationalState = default(string), IList gatewayIPConfigurations = default(IList), IList authenticationCertificates = default(IList), IList sslCertificates = default(IList), IList frontendIPConfigurations = default(IList), IList frontendPorts = default(IList), IList probes = default(IList), IList backendAddressPools = default(IList), IList backendHttpSettingsCollection = default(IList), IList httpListeners = default(IList), IList urlPathMaps = default(IList), IList requestRoutingRules = default(IList), ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration = default(ApplicationGatewayWebApplicationFirewallConfiguration), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { Sku = sku; @@ -93,13 +101,13 @@ public ApplicationGateway() { } /// /// Gets or sets SKU of the application gateway resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sku")] + [JsonProperty(PropertyName = "properties.sku")] public ApplicationGatewaySku Sku { get; set; } /// /// Gets or sets SSL policy of the application gateway resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sslPolicy")] + [JsonProperty(PropertyName = "properties.sslPolicy")] public ApplicationGatewaySslPolicy SslPolicy { get; set; } /// @@ -108,91 +116,91 @@ public ApplicationGateway() { } /// 'Stopping'. Possible values include: 'Stopped', 'Starting', /// 'Running', 'Stopping' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.operationalState")] - public string OperationalState { get; private set; } + [JsonProperty(PropertyName = "properties.operationalState")] + public string OperationalState { get; protected set; } /// /// Gets or sets subnets of application the gateway resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayIPConfigurations")] - public System.Collections.Generic.IList GatewayIPConfigurations { get; set; } + [JsonProperty(PropertyName = "properties.gatewayIPConfigurations")] + public IList GatewayIPConfigurations { get; set; } /// - /// Gets or sets authentication certificates of the application - /// gateway resource. + /// Gets or sets authentication certificates of the application gateway + /// resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authenticationCertificates")] - public System.Collections.Generic.IList AuthenticationCertificates { get; set; } + [JsonProperty(PropertyName = "properties.authenticationCertificates")] + public IList AuthenticationCertificates { get; set; } /// /// Gets or sets SSL certificates of the application gateway resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sslCertificates")] - public System.Collections.Generic.IList SslCertificates { get; set; } + [JsonProperty(PropertyName = "properties.sslCertificates")] + public IList SslCertificates { get; set; } /// /// Gets or sets frontend IP addresses of the application gateway /// resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfigurations")] - public System.Collections.Generic.IList FrontendIPConfigurations { get; set; } + [JsonProperty(PropertyName = "properties.frontendIPConfigurations")] + public IList FrontendIPConfigurations { get; set; } /// /// Gets or sets frontend ports of the application gateway resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPorts")] - public System.Collections.Generic.IList FrontendPorts { get; set; } + [JsonProperty(PropertyName = "properties.frontendPorts")] + public IList FrontendPorts { get; set; } /// /// Gets or sets probes of the application gateway resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.probes")] - public System.Collections.Generic.IList Probes { get; set; } + [JsonProperty(PropertyName = "properties.probes")] + public IList Probes { get; set; } /// /// Gets or sets backend address pool of the application gateway /// resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPools")] - public System.Collections.Generic.IList BackendAddressPools { get; set; } + [JsonProperty(PropertyName = "properties.backendAddressPools")] + public IList BackendAddressPools { get; set; } /// /// Gets or sets backend http settings of the application gateway /// resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendHttpSettingsCollection")] - public System.Collections.Generic.IList BackendHttpSettingsCollection { get; set; } + [JsonProperty(PropertyName = "properties.backendHttpSettingsCollection")] + public IList BackendHttpSettingsCollection { get; set; } /// /// Gets or sets http listeners of the application gateway resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.httpListeners")] - public System.Collections.Generic.IList HttpListeners { get; set; } + [JsonProperty(PropertyName = "properties.httpListeners")] + public IList HttpListeners { get; set; } /// /// Gets or sets URL path map of the application gateway resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.urlPathMaps")] - public System.Collections.Generic.IList UrlPathMaps { get; set; } + [JsonProperty(PropertyName = "properties.urlPathMaps")] + public IList UrlPathMaps { get; set; } /// /// Gets or sets request routing rules of the application gateway /// resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.requestRoutingRules")] - public System.Collections.Generic.IList RequestRoutingRules { get; set; } + [JsonProperty(PropertyName = "properties.requestRoutingRules")] + public IList RequestRoutingRules { get; set; } /// /// Gets or sets web application firewall configuration. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.webApplicationFirewallConfiguration")] + [JsonProperty(PropertyName = "properties.webApplicationFirewallConfiguration")] public ApplicationGatewayWebApplicationFirewallConfiguration WebApplicationFirewallConfiguration { get; set; } /// /// Gets or sets resource GUID property of the application gateway /// resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// @@ -200,28 +208,29 @@ public ApplicationGateway() { } /// resource. Possible values are: 'Updating', 'Deleting', and /// 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.WebApplicationFirewallConfiguration != null) + if (WebApplicationFirewallConfiguration != null) { - this.WebApplicationFirewallConfiguration.Validate(); + WebApplicationFirewallConfiguration.Validate(); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayAuthenticationCertificate.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayAuthenticationCertificate.cs index 6f075ae501310..8680f153810be 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayAuthenticationCertificate.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayAuthenticationCertificate.cs @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// Authentication certificates of an application gateway. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class ApplicationGatewayAuthenticationCertificate : SubResource { /// @@ -48,7 +54,7 @@ public ApplicationGatewayAuthenticationCertificate() { } /// /// Gets or sets certificate public data. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.data")] + [JsonProperty(PropertyName = "properties.data")] public string Data { get; set; } /// @@ -56,22 +62,23 @@ public ApplicationGatewayAuthenticationCertificate() { } /// resource. Possible values are: 'Updating', 'Deleting', and /// 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets name of the resource that is unique within a resource /// group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddress.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddress.cs index 105689b3c5d3e..0dc86f884b065 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddress.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddress.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; using System.Linq; /// @@ -36,14 +40,15 @@ public ApplicationGatewayBackendAddress() { } /// /// Gets or sets fully qualified domain name (FQDN). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "fqdn")] + [JsonProperty(PropertyName = "fqdn")] public string Fqdn { get; set; } /// /// Gets or sets IP address /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ipAddress")] + [JsonProperty(PropertyName = "ipAddress")] public string IpAddress { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddressPool.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddressPool.cs index e50e84d1972dc..46787d094f8f2 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddressPool.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddressPool.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Backend Address Pool of an application gateway. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class ApplicationGatewayBackendAddressPool : SubResource { /// @@ -31,13 +39,13 @@ public ApplicationGatewayBackendAddressPool() { } /// IPs defined in network interfaces. /// Backend addresses /// Provisioning state of the backend - /// address pool resource. Possible values are: 'Updating', - /// 'Deleting', and 'Failed'. - /// Resource that is unique within a resource - /// group. This name can be used to access the resource. + /// address pool resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// Resource that is unique within a resource group. + /// This name can be used to access the resource. /// A unique read-only string that changes whenever /// the resource is updated. - public ApplicationGatewayBackendAddressPool(string id = default(string), System.Collections.Generic.IList backendIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendAddresses = default(System.Collections.Generic.IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) + public ApplicationGatewayBackendAddressPool(string id = default(string), IList backendIPConfigurations = default(IList), IList backendAddresses = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { BackendIPConfigurations = backendIPConfigurations; @@ -51,36 +59,37 @@ public ApplicationGatewayBackendAddressPool() { } /// Gets or sets collection of references to IPs defined in network /// interfaces. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendIPConfigurations")] - public System.Collections.Generic.IList BackendIPConfigurations { get; set; } + [JsonProperty(PropertyName = "properties.backendIPConfigurations")] + public IList BackendIPConfigurations { get; set; } /// /// Gets or sets backend addresses /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddresses")] - public System.Collections.Generic.IList BackendAddresses { get; set; } + [JsonProperty(PropertyName = "properties.backendAddresses")] + public IList BackendAddresses { get; set; } /// /// Gets or sets provisioning state of the backend address pool /// resource. Possible values are: 'Updating', 'Deleting', and /// 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets resource that is unique within a resource group. This /// name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealth.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealth.cs index 05ec24cc529bf..7bb1cbfbb3a4d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealth.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealth.cs @@ -1,13 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -25,15 +31,16 @@ public ApplicationGatewayBackendHealth() { } /// Initializes a new instance of the ApplicationGatewayBackendHealth /// class. /// - public ApplicationGatewayBackendHealth(System.Collections.Generic.IList backendAddressPools = default(System.Collections.Generic.IList)) + public ApplicationGatewayBackendHealth(IList backendAddressPools = default(IList)) { BackendAddressPools = backendAddressPools; } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "backendAddressPools")] - public System.Collections.Generic.IList BackendAddressPools { get; set; } + [JsonProperty(PropertyName = "backendAddressPools")] + public IList BackendAddressPools { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs index 87ef7c2faa47c..4eddf6d181a64 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs @@ -1,13 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -27,9 +33,9 @@ public ApplicationGatewayBackendHealthHttpSettings() { } /// /// Reference of an /// ApplicationGatewayBackendHttpSettings resource. - /// List of - /// ApplicationGatewayBackendHealthServer resources. - public ApplicationGatewayBackendHealthHttpSettings(ApplicationGatewayBackendHttpSettings backendHttpSettings = default(ApplicationGatewayBackendHttpSettings), System.Collections.Generic.IList servers = default(System.Collections.Generic.IList)) + /// List of ApplicationGatewayBackendHealthServer + /// resources. + public ApplicationGatewayBackendHealthHttpSettings(ApplicationGatewayBackendHttpSettings backendHttpSettings = default(ApplicationGatewayBackendHttpSettings), IList servers = default(IList)) { BackendHttpSettings = backendHttpSettings; Servers = servers; @@ -39,15 +45,16 @@ public ApplicationGatewayBackendHealthHttpSettings() { } /// Gets or sets reference of an ApplicationGatewayBackendHttpSettings /// resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "backendHttpSettings")] + [JsonProperty(PropertyName = "backendHttpSettings")] public ApplicationGatewayBackendHttpSettings BackendHttpSettings { get; set; } /// /// Gets or sets list of ApplicationGatewayBackendHealthServer /// resources. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "servers")] - public System.Collections.Generic.IList Servers { get; set; } + [JsonProperty(PropertyName = "servers")] + public IList Servers { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthPool.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthPool.cs index df82eed1fe808..b8975606d3e68 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthPool.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthPool.cs @@ -1,13 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -29,7 +35,7 @@ public ApplicationGatewayBackendHealthPool() { } /// ApplicationGatewayBackendAddressPool resource. /// List of /// ApplicationGatewayBackendHealthHttpSettings resources. - public ApplicationGatewayBackendHealthPool(ApplicationGatewayBackendAddressPool backendAddressPool = default(ApplicationGatewayBackendAddressPool), System.Collections.Generic.IList backendHttpSettingsCollection = default(System.Collections.Generic.IList)) + public ApplicationGatewayBackendHealthPool(ApplicationGatewayBackendAddressPool backendAddressPool = default(ApplicationGatewayBackendAddressPool), IList backendHttpSettingsCollection = default(IList)) { BackendAddressPool = backendAddressPool; BackendHttpSettingsCollection = backendHttpSettingsCollection; @@ -39,15 +45,16 @@ public ApplicationGatewayBackendHealthPool() { } /// Gets or sets reference of an ApplicationGatewayBackendAddressPool /// resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "backendAddressPool")] + [JsonProperty(PropertyName = "backendAddressPool")] public ApplicationGatewayBackendAddressPool BackendAddressPool { get; set; } /// /// Gets or sets list of ApplicationGatewayBackendHealthHttpSettings /// resources. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "backendHttpSettingsCollection")] - public System.Collections.Generic.IList BackendHttpSettingsCollection { get; set; } + [JsonProperty(PropertyName = "backendHttpSettingsCollection")] + public IList BackendHttpSettingsCollection { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServer.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServer.cs index 0254d71f1df24..6005cd2f240d9 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServer.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServer.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; using System.Linq; /// @@ -28,9 +32,9 @@ public ApplicationGatewayBackendHealthServer() { } /// IP address or FQDN of backend server. /// Reference of IP configuration of /// backend server. - /// Health of backend server. Possible values - /// are: 'Unknown', 'Up', 'Down', and 'Partial'. Possible values - /// include: 'Unknown', 'Up', 'Down', 'Partial' + /// Health of backend server. Possible values are: + /// 'Unknown', 'Up', 'Down', and 'Partial'. Possible values include: + /// 'Unknown', 'Up', 'Down', 'Partial' public ApplicationGatewayBackendHealthServer(string address = default(string), SubResource ipConfiguration = default(SubResource), string health = default(string)) { Address = address; @@ -41,13 +45,13 @@ public ApplicationGatewayBackendHealthServer() { } /// /// Gets or sets IP address or FQDN of backend server. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "address")] + [JsonProperty(PropertyName = "address")] public string Address { get; set; } /// /// Gets or sets reference of IP configuration of backend server. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfiguration")] + [JsonProperty(PropertyName = "ipConfiguration")] public SubResource IpConfiguration { get; set; } /// @@ -55,8 +59,9 @@ public ApplicationGatewayBackendHealthServer() { } /// 'Unknown', 'Up', 'Down', and 'Partial'. Possible values include: /// 'Unknown', 'Up', 'Down', 'Partial' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "health")] + [JsonProperty(PropertyName = "health")] public string Health { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServerHealth.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServerHealth.cs index ed002f0942302..db0321dc0ffe7 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServerHealth.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServerHealth.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for ApplicationGatewayBackendHealthServerHealth. @@ -20,3 +23,4 @@ public static class ApplicationGatewayBackendHealthServerHealth public const string Partial = "Partial"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHttpSettings.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHttpSettings.cs index 44d43ec067fa1..8b2a1c9329a1a 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHttpSettings.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHttpSettings.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Backend address pool settings of an application gateway. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class ApplicationGatewayBackendHttpSettings : SubResource { /// @@ -35,8 +43,8 @@ public ApplicationGatewayBackendHttpSettings() { } /// 'Enabled', 'Disabled' /// Request timeout in seconds. /// Application Gateway will fail the request if response is not - /// received within RequestTimeout. Acceptable values are from 1 - /// second to 86400 seconds. + /// received within RequestTimeout. Acceptable values are from 1 second + /// to 86400 seconds. /// Probe resource of an application /// gateway. /// Array of references to @@ -49,7 +57,7 @@ public ApplicationGatewayBackendHttpSettings() { } /// resource. /// A unique read-only string that changes whenever /// the resource is updated. - public ApplicationGatewayBackendHttpSettings(string id = default(string), int? port = default(int?), string protocol = default(string), string cookieBasedAffinity = default(string), int? requestTimeout = default(int?), SubResource probe = default(SubResource), System.Collections.Generic.IList authenticationCertificates = default(System.Collections.Generic.IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) + public ApplicationGatewayBackendHttpSettings(string id = default(string), int? port = default(int?), string protocol = default(string), string cookieBasedAffinity = default(string), int? requestTimeout = default(int?), SubResource probe = default(SubResource), IList authenticationCertificates = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { Port = port; @@ -66,66 +74,66 @@ public ApplicationGatewayBackendHttpSettings() { } /// /// Gets or sets port /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.port")] + [JsonProperty(PropertyName = "properties.port")] public int? Port { get; set; } /// /// Gets or sets protocol. Possible values are: 'Http' and 'Https'. /// Possible values include: 'Http', 'Https' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + [JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// /// Gets or sets cookie based affinity. Possible values are: 'Enabled' /// and 'Disabled'. Possible values include: 'Enabled', 'Disabled' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.cookieBasedAffinity")] + [JsonProperty(PropertyName = "properties.cookieBasedAffinity")] public string CookieBasedAffinity { get; set; } /// /// Gets or sets request timeout in seconds. Application Gateway will - /// fail the request if response is not received within - /// RequestTimeout. Acceptable values are from 1 second to 86400 - /// seconds. + /// fail the request if response is not received within RequestTimeout. + /// Acceptable values are from 1 second to 86400 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.requestTimeout")] + [JsonProperty(PropertyName = "properties.requestTimeout")] public int? RequestTimeout { get; set; } /// /// Gets or sets probe resource of an application gateway. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.probe")] + [JsonProperty(PropertyName = "properties.probe")] public SubResource Probe { get; set; } /// /// Gets or sets array of references to application gateway /// authentication certificates. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authenticationCertificates")] - public System.Collections.Generic.IList AuthenticationCertificates { get; set; } + [JsonProperty(PropertyName = "properties.authenticationCertificates")] + public IList AuthenticationCertificates { get; set; } /// /// Gets or sets provisioning state of the backend http settings /// resource. Possible values are: 'Updating', 'Deleting', and /// 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets name of the resource that is unique within a resource /// group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayCookieBasedAffinity.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayCookieBasedAffinity.cs index 7bd1177ddf164..0c18e75ea452e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayCookieBasedAffinity.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayCookieBasedAffinity.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for ApplicationGatewayCookieBasedAffinity. @@ -18,3 +21,4 @@ public static class ApplicationGatewayCookieBasedAffinity public const string Disabled = "Disabled"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFirewallMode.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFirewallMode.cs index de6759e58462a..d90d48a8540af 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFirewallMode.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFirewallMode.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for ApplicationGatewayFirewallMode. @@ -18,3 +21,4 @@ public static class ApplicationGatewayFirewallMode public const string Prevention = "Prevention"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs index 78b81d9bb770f..15365ef7e9e7e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// Frontend IP configuration of an application gateway. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class ApplicationGatewayFrontendIPConfiguration : SubResource { /// @@ -35,8 +41,8 @@ public ApplicationGatewayFrontendIPConfiguration() { } /// Reference of the subnet resource. /// Reference of the PublicIP /// resource. - /// Provisioning state of the public - /// IP resource. Possible values are: 'Updating', 'Deleting', and + /// Provisioning state of the public IP + /// resource. Possible values are: 'Updating', 'Deleting', and /// 'Failed'. /// Name of the resource that is unique within a /// resource group. This name can be used to access the @@ -59,7 +65,7 @@ public ApplicationGatewayFrontendIPConfiguration() { } /// Gets or sets privateIPAddress of the network interface IP /// Configuration. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddress")] + [JsonProperty(PropertyName = "properties.privateIPAddress")] public string PrivateIPAddress { get; set; } /// @@ -67,41 +73,42 @@ public ApplicationGatewayFrontendIPConfiguration() { } /// 'Static' and 'Dynamic'. Possible values include: 'Static', /// 'Dynamic' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] + [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] public string PrivateIPAllocationMethod { get; set; } /// /// Gets or sets reference of the subnet resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + [JsonProperty(PropertyName = "properties.subnet")] public SubResource Subnet { get; set; } /// /// Gets or sets reference of the PublicIP resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddress")] + [JsonProperty(PropertyName = "properties.publicIPAddress")] public SubResource PublicIPAddress { get; set; } /// - /// Gets or sets provisioning state of the public IP resource. - /// Possible values are: 'Updating', 'Deleting', and 'Failed'. + /// Gets or sets provisioning state of the public IP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets name of the resource that is unique within a resource /// group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendPort.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendPort.cs index 0d7021278738e..ea18406784618 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendPort.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendPort.cs @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// Frontend port of an application gateway. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class ApplicationGatewayFrontendPort : SubResource { /// @@ -48,29 +54,30 @@ public ApplicationGatewayFrontendPort() { } /// /// Gets or sets frontend port /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.port")] + [JsonProperty(PropertyName = "properties.port")] public int? Port { get; set; } /// /// Gets or sets provisioning state of the frontend port resource. /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets name of the resource that is unique within a resource /// group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayHttpListener.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayHttpListener.cs index 12d4d54e6ac63..330341e081938 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayHttpListener.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayHttpListener.cs @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// Http listener of an application gateway. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class ApplicationGatewayHttpListener : SubResource { /// @@ -29,8 +35,8 @@ public ApplicationGatewayHttpListener() { } /// Resource ID. /// Frontend IP configuration /// resource of an application gateway. - /// Frontend port resource of an - /// application gateway. + /// Frontend port resource of an application + /// gateway. /// Protocol. Possible values are: 'Http' and /// 'Https'. Possible values include: 'Http', 'Https' /// Host name of HTTP listener. @@ -39,8 +45,8 @@ public ApplicationGatewayHttpListener() { } /// Applicable only if /// protocol is https. Enables SNI for multi-hosting. /// Provisioning state of the HTTP - /// listener resource. Possible values are: 'Updating', 'Deleting', - /// and 'Failed'. + /// listener resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// Name of the resource that is unique within a /// resource group. This name can be used to access the /// resource. @@ -64,61 +70,62 @@ public ApplicationGatewayHttpListener() { } /// Gets or sets frontend IP configuration resource of an application /// gateway. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfiguration")] + [JsonProperty(PropertyName = "properties.frontendIPConfiguration")] public SubResource FrontendIPConfiguration { get; set; } /// /// Gets or sets frontend port resource of an application gateway. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPort")] + [JsonProperty(PropertyName = "properties.frontendPort")] public SubResource FrontendPort { get; set; } /// /// Gets or sets protocol. Possible values are: 'Http' and 'Https'. /// Possible values include: 'Http', 'Https' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + [JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// /// Gets or sets host name of HTTP listener. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hostName")] + [JsonProperty(PropertyName = "properties.hostName")] public string HostName { get; set; } /// /// Gets or sets SSL certificate resource of an application gateway. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sslCertificate")] + [JsonProperty(PropertyName = "properties.sslCertificate")] public SubResource SslCertificate { get; set; } /// /// Gets or sets applicable only if protocol is https. Enables SNI for /// multi-hosting. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.requireServerNameIndication")] + [JsonProperty(PropertyName = "properties.requireServerNameIndication")] public bool? RequireServerNameIndication { get; set; } /// /// Gets or sets provisioning state of the HTTP listener resource. /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets name of the resource that is unique within a resource /// group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayIpConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayIpConfiguration.cs index 30e7d5a83c5d5..638422131f6d6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayIpConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayIpConfiguration.cs @@ -1,31 +1,37 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// IP configuration of an application gateway. Currently 1 public and 1 /// private IP configuration is allowed. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class ApplicationGatewayIPConfiguration : SubResource { /// - /// Initializes a new instance of the - /// ApplicationGatewayIPConfiguration class. + /// Initializes a new instance of the ApplicationGatewayIPConfiguration + /// class. /// public ApplicationGatewayIPConfiguration() { } /// - /// Initializes a new instance of the - /// ApplicationGatewayIPConfiguration class. + /// Initializes a new instance of the ApplicationGatewayIPConfiguration + /// class. /// /// Resource ID. /// Reference of the subnet resource. A subnet @@ -51,7 +57,7 @@ public ApplicationGatewayIPConfiguration() { } /// Gets or sets reference of the subnet resource. A subnet from where /// application gateway gets its private address. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + [JsonProperty(PropertyName = "properties.subnet")] public SubResource Subnet { get; set; } /// @@ -59,22 +65,23 @@ public ApplicationGatewayIPConfiguration() { } /// resource. Possible values are: 'Updating', 'Deleting', and /// 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets name of the resource that is unique within a resource /// group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayOperationalState.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayOperationalState.cs index 80ecacf9e26ef..82005d4c9f3e7 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayOperationalState.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayOperationalState.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for ApplicationGatewayOperationalState. @@ -20,3 +23,4 @@ public static class ApplicationGatewayOperationalState public const string Stopping = "Stopping"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayPathRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayPathRule.cs index b822b881642de..22c4e3861fbe2 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayPathRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayPathRule.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Path rule of URL path map of an application gateway. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class ApplicationGatewayPathRule : SubResource { /// @@ -28,17 +36,16 @@ public ApplicationGatewayPathRule() { } /// Path rules of URL path map. /// Backend address pool resource of /// URL path map. - /// Backend http settings resource - /// of URL path map. - /// Path rule of URL path map - /// resource. Possible values are: 'Updating', 'Deleting', and - /// 'Failed'. + /// Backend http settings resource of + /// URL path map. + /// Path rule of URL path map resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// Name of the resource that is unique within a /// resource group. This name can be used to access the /// resource. /// A unique read-only string that changes whenever /// the resource is updated. - public ApplicationGatewayPathRule(string id = default(string), System.Collections.Generic.IList paths = default(System.Collections.Generic.IList), SubResource backendAddressPool = default(SubResource), SubResource backendHttpSettings = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string)) + public ApplicationGatewayPathRule(string id = default(string), IList paths = default(IList), SubResource backendAddressPool = default(SubResource), SubResource backendHttpSettings = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { Paths = paths; @@ -52,41 +59,42 @@ public ApplicationGatewayPathRule() { } /// /// Gets or sets path rules of URL path map. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.paths")] - public System.Collections.Generic.IList Paths { get; set; } + [JsonProperty(PropertyName = "properties.paths")] + public IList Paths { get; set; } /// /// Gets or sets backend address pool resource of URL path map. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPool")] + [JsonProperty(PropertyName = "properties.backendAddressPool")] public SubResource BackendAddressPool { get; set; } /// /// Gets or sets backend http settings resource of URL path map. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendHttpSettings")] + [JsonProperty(PropertyName = "properties.backendHttpSettings")] public SubResource BackendHttpSettings { get; set; } /// /// Gets or sets path rule of URL path map resource. Possible values /// are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets name of the resource that is unique within a resource /// group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProbe.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProbe.cs index 02365e2d42fe8..6f8786ca36f67 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProbe.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProbe.cs @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// Probe of the application gateway. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class ApplicationGatewayProbe : SubResource { /// @@ -29,18 +35,18 @@ public ApplicationGatewayProbe() { } /// 'Https'. Possible values include: 'Http', 'Https' /// Host name to send the probe to. /// Relative path of probe. Valid path starts from - /// '/'. Probe is sent to ://: - /// The probing interval in seconds. This is - /// the time interval between two consecutive probes. Acceptable - /// values are from 1 second to 86400 seconds. - /// the probe timeout in seconds. Probe marked - /// as failed if valid response is not received with this timeout - /// period. Acceptable values are from 1 second to 86400 - /// seconds. + /// '/'. Probe is sent to + /// <Protocol>://<host>:<port><path> + /// The probing interval in seconds. This is the + /// time interval between two consecutive probes. Acceptable values are + /// from 1 second to 86400 seconds. + /// the probe timeout in seconds. Probe marked as + /// failed if valid response is not received with this timeout period. + /// Acceptable values are from 1 second to 86400 seconds. /// The probe retry count. Backend - /// server is marked down after consecutive probe failure count - /// reaches UnhealthyThreshold. Acceptable values are from 1 second - /// to 20. + /// server is marked down after consecutive probe failure count reaches + /// UnhealthyThreshold. Acceptable values are from 1 second to + /// 20. /// Provisioning state of the backend /// http settings resource. Possible values are: 'Updating', /// 'Deleting', and 'Failed'. @@ -67,29 +73,29 @@ public ApplicationGatewayProbe() { } /// Gets or sets protocol. Possible values are: 'Http' and 'Https'. /// Possible values include: 'Http', 'Https' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + [JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// /// Gets or sets host name to send the probe to. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.host")] + [JsonProperty(PropertyName = "properties.host")] public string Host { get; set; } /// /// Gets or sets relative path of probe. Valid path starts from '/'. /// Probe is sent to - /// <Protocol>://<host>:<port><path> + /// &lt;Protocol&gt;://&lt;host&gt;:&lt;port&gt;&lt;path&gt; /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.path")] + [JsonProperty(PropertyName = "properties.path")] public string Path { get; set; } /// /// Gets or sets the probing interval in seconds. This is the time - /// interval between two consecutive probes. Acceptable values are - /// from 1 second to 86400 seconds. + /// interval between two consecutive probes. Acceptable values are from + /// 1 second to 86400 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.interval")] + [JsonProperty(PropertyName = "properties.interval")] public int? Interval { get; set; } /// @@ -97,7 +103,7 @@ public ApplicationGatewayProbe() { } /// if valid response is not received with this timeout period. /// Acceptable values are from 1 second to 86400 seconds. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeout")] + [JsonProperty(PropertyName = "properties.timeout")] public int? Timeout { get; set; } /// @@ -105,7 +111,7 @@ public ApplicationGatewayProbe() { } /// after consecutive probe failure count reaches UnhealthyThreshold. /// Acceptable values are from 1 second to 20. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.unhealthyThreshold")] + [JsonProperty(PropertyName = "properties.unhealthyThreshold")] public int? UnhealthyThreshold { get; set; } /// @@ -113,22 +119,23 @@ public ApplicationGatewayProbe() { } /// resource. Possible values are: 'Updating', 'Deleting', and /// 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets name of the resource that is unique within a resource /// group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProtocol.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProtocol.cs index f0178991a55a6..e74238d4d0215 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProtocol.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProtocol.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for ApplicationGatewayProtocol. @@ -18,3 +21,4 @@ public static class ApplicationGatewayProtocol public const string Https = "Https"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRule.cs index 2f91b2158b984..542b6a384fbf1 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRule.cs @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// Request routing rule of an application gateway. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class ApplicationGatewayRequestRoutingRule : SubResource { /// @@ -39,8 +45,8 @@ public ApplicationGatewayRequestRoutingRule() { } /// URL path map resource of the application /// gateway. /// Provisioning state of the request - /// routing rule resource. Possible values are: 'Updating', - /// 'Deleting', and 'Failed'. + /// routing rule resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. /// Name of the resource that is unique within a /// resource group. This name can be used to access the /// resource. @@ -64,32 +70,32 @@ public ApplicationGatewayRequestRoutingRule() { } /// 'PathBasedRouting'. Possible values include: 'Basic', /// 'PathBasedRouting' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ruleType")] + [JsonProperty(PropertyName = "properties.ruleType")] public string RuleType { get; set; } /// /// Gets or sets backend address pool resource of the application /// gateway. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPool")] + [JsonProperty(PropertyName = "properties.backendAddressPool")] public SubResource BackendAddressPool { get; set; } /// /// Gets or sets frontend port resource of the application gateway. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendHttpSettings")] + [JsonProperty(PropertyName = "properties.backendHttpSettings")] public SubResource BackendHttpSettings { get; set; } /// /// Gets or sets http listener resource of the application gateway. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.httpListener")] + [JsonProperty(PropertyName = "properties.httpListener")] public SubResource HttpListener { get; set; } /// /// Gets or sets URL path map resource of the application gateway. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.urlPathMap")] + [JsonProperty(PropertyName = "properties.urlPathMap")] public SubResource UrlPathMap { get; set; } /// @@ -97,22 +103,23 @@ public ApplicationGatewayRequestRoutingRule() { } /// resource. Possible values are: 'Updating', 'Deleting', and /// 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets name of the resource that is unique within a resource /// group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRuleType.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRuleType.cs index 95268fdd91661..14358e982a4df 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRuleType.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRuleType.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for ApplicationGatewayRequestRoutingRuleType. @@ -18,3 +21,4 @@ public static class ApplicationGatewayRequestRoutingRuleType public const string PathBasedRouting = "PathBasedRouting"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySku.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySku.cs index 39756484757d6..117e1bf1e4d08 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySku.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySku.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; using System.Linq; /// @@ -24,9 +28,9 @@ public ApplicationGatewaySku() { } /// Initializes a new instance of the ApplicationGatewaySku class. /// /// Name of an application gateway SKU. Possible - /// values are: 'Standard_Small', 'Standard_Medium', - /// 'Standard_Large', 'WAF_Medium', and 'WAF_Large'. Possible values - /// include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', + /// values are: 'Standard_Small', 'Standard_Medium', 'Standard_Large', + /// 'WAF_Medium', and 'WAF_Large'. Possible values include: + /// 'Standard_Small', 'Standard_Medium', 'Standard_Large', /// 'WAF_Medium', 'WAF_Large' /// Tier of an application gateway. Possible values /// are: 'Standard' and 'WAF'. Possible values include: 'Standard', @@ -47,21 +51,22 @@ public ApplicationGatewaySku() { } /// 'Standard_Small', 'Standard_Medium', 'Standard_Large', /// 'WAF_Medium', 'WAF_Large' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets tier of an application gateway. Possible values are: /// 'Standard' and 'WAF'. Possible values include: 'Standard', 'WAF' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + [JsonProperty(PropertyName = "tier")] public string Tier { get; set; } /// /// Gets or sets capacity (instance count) of an application gateway. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "capacity")] + [JsonProperty(PropertyName = "capacity")] public int? Capacity { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySkuName.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySkuName.cs index 56356dcf1342b..c27896f1376da 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySkuName.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySkuName.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for ApplicationGatewaySkuName. @@ -21,3 +24,4 @@ public static class ApplicationGatewaySkuName public const string WAFLarge = "WAF_Large"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslCertificate.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslCertificate.cs index e0b9db8e32b99..d876a120f7693 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslCertificate.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslCertificate.cs @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// SSL certificates of an application gateway. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class ApplicationGatewaySslCertificate : SubResource { /// @@ -27,10 +33,10 @@ public ApplicationGatewaySslCertificate() { } /// class. /// /// Resource ID. - /// Base-64 encoded pfx certificate. Only - /// applicable in PUT Request. - /// Password for the pfx file specified in - /// data. Only applicable in PUT request. + /// Base-64 encoded pfx certificate. Only applicable + /// in PUT Request. + /// Password for the pfx file specified in data. + /// Only applicable in PUT request. /// Base-64 encoded Public cert data /// corresponding to pfx specified in data. Only applicable in GET /// request. @@ -57,43 +63,44 @@ public ApplicationGatewaySslCertificate() { } /// Gets or sets base-64 encoded pfx certificate. Only applicable in /// PUT Request. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.data")] + [JsonProperty(PropertyName = "properties.data")] public string Data { get; set; } /// /// Gets or sets password for the pfx file specified in data. Only /// applicable in PUT request. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.password")] + [JsonProperty(PropertyName = "properties.password")] public string Password { get; set; } /// /// Gets or sets base-64 encoded Public cert data corresponding to pfx /// specified in data. Only applicable in GET request. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicCertData")] + [JsonProperty(PropertyName = "properties.publicCertData")] public string PublicCertData { get; set; } /// /// Gets or sets provisioning state of the SSL certificate resource /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets name of the resource that is unique within a resource /// group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslPolicy.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslPolicy.cs index 682c67093e487..459001255b6bf 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslPolicy.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslPolicy.cs @@ -1,13 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -26,9 +32,9 @@ public ApplicationGatewaySslPolicy() { } /// class. /// /// SSL protocols to be disabled on - /// application gateway. Possible values are: 'TLSv1_0', 'TLSv1_1', - /// and 'TLSv1_2'. - public ApplicationGatewaySslPolicy(System.Collections.Generic.IList disabledSslProtocols = default(System.Collections.Generic.IList)) + /// application gateway. Possible values are: 'TLSv1_0', 'TLSv1_1', and + /// 'TLSv1_2'. + public ApplicationGatewaySslPolicy(IList disabledSslProtocols = default(IList)) { DisabledSslProtocols = disabledSslProtocols; } @@ -37,8 +43,9 @@ public ApplicationGatewaySslPolicy() { } /// Gets or sets SSL protocols to be disabled on application gateway. /// Possible values are: 'TLSv1_0', 'TLSv1_1', and 'TLSv1_2'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "disabledSslProtocols")] - public System.Collections.Generic.IList DisabledSslProtocols { get; set; } + [JsonProperty(PropertyName = "disabledSslProtocols")] + public IList DisabledSslProtocols { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslProtocol.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslProtocol.cs index 78d050f50a6fa..12d974b05df5e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslProtocol.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslProtocol.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for ApplicationGatewaySslProtocol. @@ -19,3 +22,4 @@ public static class ApplicationGatewaySslProtocol public const string TLSv12 = "TLSv1_2"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayTier.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayTier.cs index 9a4a3b604044d..be6ac6cb41225 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayTier.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayTier.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for ApplicationGatewayTier. @@ -18,3 +21,4 @@ public static class ApplicationGatewayTier public const string WAF = "WAF"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayUrlPathMap.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayUrlPathMap.cs index 2b26e1d036a09..b549b448381e4 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayUrlPathMap.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayUrlPathMap.cs @@ -1,20 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// UrlPathMaps give a url path to the backend mapping information for /// PathBasedRouting. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class ApplicationGatewayUrlPathMap : SubResource { /// @@ -41,7 +49,7 @@ public ApplicationGatewayUrlPathMap() { } /// resource. /// A unique read-only string that changes whenever /// the resource is updated. - public ApplicationGatewayUrlPathMap(string id = default(string), SubResource defaultBackendAddressPool = default(SubResource), SubResource defaultBackendHttpSettings = default(SubResource), System.Collections.Generic.IList pathRules = default(System.Collections.Generic.IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) + public ApplicationGatewayUrlPathMap(string id = default(string), SubResource defaultBackendAddressPool = default(SubResource), SubResource defaultBackendHttpSettings = default(SubResource), IList pathRules = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { DefaultBackendAddressPool = defaultBackendAddressPool; @@ -55,43 +63,44 @@ public ApplicationGatewayUrlPathMap() { } /// /// Gets or sets default backend address pool resource of URL path map. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultBackendAddressPool")] + [JsonProperty(PropertyName = "properties.defaultBackendAddressPool")] public SubResource DefaultBackendAddressPool { get; set; } /// /// Gets or sets default backend http settings resource of URL path /// map. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultBackendHttpSettings")] + [JsonProperty(PropertyName = "properties.defaultBackendHttpSettings")] public SubResource DefaultBackendHttpSettings { get; set; } /// /// Gets or sets path rule of URL path map resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.pathRules")] - public System.Collections.Generic.IList PathRules { get; set; } + [JsonProperty(PropertyName = "properties.pathRules")] + public IList PathRules { get; set; } /// /// Gets or sets provisioning state of the backend http settings /// resource. Possible values are: 'Updating', 'Deleting', and /// 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets name of the resource that is unique within a resource /// group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayWebApplicationFirewallConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayWebApplicationFirewallConfiguration.cs index 3c501192f77d0..a0cd36776df69 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayWebApplicationFirewallConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayWebApplicationFirewallConfiguration.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; using System.Linq; /// @@ -28,8 +32,8 @@ public ApplicationGatewayWebApplicationFirewallConfiguration() { } /// Whether the web application firewall is /// enabled. /// Web application firewall mode. Possible - /// values are: 'Detection' and 'Prevention'. Possible values - /// include: 'Detection', 'Prevention' + /// values are: 'Detection' and 'Prevention'. Possible values include: + /// 'Detection', 'Prevention' public ApplicationGatewayWebApplicationFirewallConfiguration(bool enabled, string firewallMode = default(string)) { Enabled = enabled; @@ -39,26 +43,26 @@ public ApplicationGatewayWebApplicationFirewallConfiguration() { } /// /// Gets or sets whether the web application firewall is enabled. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + [JsonProperty(PropertyName = "enabled")] public bool Enabled { get; set; } /// /// Gets or sets web application firewall mode. Possible values are: - /// 'Detection' and 'Prevention'. Possible values include: - /// 'Detection', 'Prevention' + /// 'Detection' and 'Prevention'. Possible values include: 'Detection', + /// 'Prevention' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "firewallMode")] + [JsonProperty(PropertyName = "firewallMode")] public string FirewallMode { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - //Nothing to validate } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AuthorizationUseStatus.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AuthorizationUseStatus.cs index 010f347bc0216..28a9e6418434f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AuthorizationUseStatus.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AuthorizationUseStatus.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for AuthorizationUseStatus. @@ -18,3 +21,4 @@ public static class AuthorizationUseStatus public const string InUse = "InUse"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AzureAsyncOperationResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AzureAsyncOperationResult.cs index 0565dc172bb1a..a1e4a0cb57867 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AzureAsyncOperationResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AzureAsyncOperationResult.cs @@ -1,24 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; using System.Linq; /// /// The response body contains the status of the specified asynchronous - /// operation, indicating whether it has succeeded, is in progress, or - /// has failed. Note that this status is distinct from the HTTP status - /// code returned for the Get Operation Status operation itself. If the + /// operation, indicating whether it has succeeded, is in progress, or has + /// failed. Note that this status is distinct from the HTTP status code + /// returned for the Get Operation Status operation itself. If the /// asynchronous operation succeeded, the response body includes the HTTP /// status code for the successful request. If the asynchronous operation - /// failed, the response body includes the HTTP status code for the - /// failed request and error information regarding the failure. + /// failed, the response body includes the HTTP status code for the failed + /// request and error information regarding the failure. /// public partial class AzureAsyncOperationResult { @@ -44,13 +48,14 @@ public AzureAsyncOperationResult() { } /// are: 'InProgress', 'Succeeded', and 'Failed'. Possible values /// include: 'InProgress', 'Succeeded', 'Failed' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + [JsonProperty(PropertyName = "status")] public string Status { get; set; } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + [JsonProperty(PropertyName = "error")] public Error Error { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BackendAddressPool.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BackendAddressPool.cs index 626183feb9f1f..6452d7c0d9e32 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BackendAddressPool.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BackendAddressPool.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Pool of backend IP addresses. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class BackendAddressPool : SubResource { /// @@ -25,10 +33,10 @@ public BackendAddressPool() { } /// Initializes a new instance of the BackendAddressPool class. /// /// Resource ID. - /// Gets collection of - /// references to IP addresses defined in network interfaces. - /// Gets load balancing rules that - /// use this backend address pool. + /// Gets collection of references + /// to IP addresses defined in network interfaces. + /// Gets load balancing rules that use + /// this backend address pool. /// Gets outbound rules that use this /// backend address pool. /// Get provisioning state of the @@ -39,7 +47,7 @@ public BackendAddressPool() { } /// resource. /// A unique read-only string that changes whenever /// the resource is updated. - public BackendAddressPool(string id = default(string), System.Collections.Generic.IList backendIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancingRules = default(System.Collections.Generic.IList), SubResource outboundNatRule = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string)) + public BackendAddressPool(string id = default(string), IList backendIPConfigurations = default(IList), IList loadBalancingRules = default(IList), SubResource outboundNatRule = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { BackendIPConfigurations = backendIPConfigurations; @@ -54,41 +62,42 @@ public BackendAddressPool() { } /// Gets collection of references to IP addresses defined in network /// interfaces. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendIPConfigurations")] - public System.Collections.Generic.IList BackendIPConfigurations { get; private set; } + [JsonProperty(PropertyName = "properties.backendIPConfigurations")] + public IList BackendIPConfigurations { get; protected set; } /// /// Gets load balancing rules that use this backend address pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancingRules")] - public System.Collections.Generic.IList LoadBalancingRules { get; private set; } + [JsonProperty(PropertyName = "properties.loadBalancingRules")] + public IList LoadBalancingRules { get; protected set; } /// /// Gets outbound rules that use this backend address pool. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.outboundNatRule")] - public SubResource OutboundNatRule { get; private set; } + [JsonProperty(PropertyName = "properties.outboundNatRule")] + public SubResource OutboundNatRule { get; protected set; } /// /// Gets or sets get provisioning state of the public IP resource. /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets name of the resource that is unique within a resource group. /// This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BgpSettings.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BgpSettings.cs index 5d5e24f448ad8..fb3e207c99128 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BgpSettings.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BgpSettings.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; using System.Linq; public partial class BgpSettings @@ -35,22 +39,23 @@ public BgpSettings() { } /// /// Gets or sets the BGP speaker's ASN. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "asn")] + [JsonProperty(PropertyName = "asn")] public long? Asn { get; set; } /// - /// Gets or sets the BGP peering address and BGP identifier of this - /// BGP speaker. + /// Gets or sets the BGP peering address and BGP identifier of this BGP + /// speaker. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "bgpPeeringAddress")] + [JsonProperty(PropertyName = "bgpPeeringAddress")] public string BgpPeeringAddress { get; set; } /// /// Gets or sets the weight added to routes learned from this BGP /// speaker. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "peerWeight")] + [JsonProperty(PropertyName = "peerWeight")] public int? PeerWeight { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionResetSharedKey.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionResetSharedKey.cs index b49aaf86aa073..a33a93984a014 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionResetSharedKey.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionResetSharedKey.cs @@ -1,13 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Newtonsoft.Json; using System.Linq; public partial class ConnectionResetSharedKey @@ -20,8 +25,8 @@ public ConnectionResetSharedKey() { } /// /// Initializes a new instance of the ConnectionResetSharedKey class. /// - /// The virtual network connection reset - /// shared key length, should between 1 and 128. + /// The virtual network connection reset shared + /// key length, should between 1 and 128. public ConnectionResetSharedKey(int keyLength) { KeyLength = keyLength; @@ -31,25 +36,26 @@ public ConnectionResetSharedKey(int keyLength) /// Gets or sets the virtual network connection reset shared key /// length, should between 1 and 128. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "keyLength")] + [JsonProperty(PropertyName = "keyLength")] public int KeyLength { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.KeyLength > 128) + if (KeyLength > 128) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "KeyLength", 128); + throw new ValidationException(ValidationRules.InclusiveMaximum, "KeyLength", 128); } - if (this.KeyLength < 1) + if (KeyLength < 1) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "KeyLength", 1); + throw new ValidationException(ValidationRules.InclusiveMinimum, "KeyLength", 1); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionSharedKey.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionSharedKey.cs index 191d129a18754..eb448c3b7959c 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionSharedKey.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionSharedKey.cs @@ -1,13 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -33,21 +38,22 @@ public ConnectionSharedKey(string value) /// /// Gets or sets the virtual network connection shared key value. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + [JsonProperty(PropertyName = "value")] public string Value { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (Value == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Value"); + throw new ValidationException(ValidationRules.CannotBeNull, "Value"); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DhcpOptions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DhcpOptions.cs index 3dbf10ee7f70b..c20dfee14ef6e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DhcpOptions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DhcpOptions.cs @@ -1,13 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -27,7 +33,7 @@ public DhcpOptions() { } /// /// The list of DNS servers IP /// addresses. - public DhcpOptions(System.Collections.Generic.IList dnsServers = default(System.Collections.Generic.IList)) + public DhcpOptions(IList dnsServers = default(IList)) { DnsServers = dnsServers; } @@ -35,8 +41,9 @@ public DhcpOptions() { } /// /// Gets or sets the list of DNS servers IP addresses. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "dnsServers")] - public System.Collections.Generic.IList DnsServers { get; set; } + [JsonProperty(PropertyName = "dnsServers")] + public IList DnsServers { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DnsNameAvailabilityResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DnsNameAvailabilityResult.cs index 5b1d0e9e24400..023e6d5e62dc2 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DnsNameAvailabilityResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DnsNameAvailabilityResult.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; using System.Linq; /// @@ -32,8 +36,9 @@ public DnsNameAvailabilityResult() { } /// /// Gets or sets domain availability (True/False). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "available")] + [JsonProperty(PropertyName = "available")] public bool? Available { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroup.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroup.cs index af4814e77274e..3f33f54aafdee 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroup.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroup.cs @@ -1,13 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -25,11 +31,11 @@ public EffectiveNetworkSecurityGroup() { } /// Initializes a new instance of the EffectiveNetworkSecurityGroup /// class. /// - /// The ID of network security - /// group that is applied. + /// The ID of network security group + /// that is applied. /// A collection of effective /// security rules. - public EffectiveNetworkSecurityGroup(SubResource networkSecurityGroup = default(SubResource), EffectiveNetworkSecurityGroupAssociation association = default(EffectiveNetworkSecurityGroupAssociation), System.Collections.Generic.IList effectiveSecurityRules = default(System.Collections.Generic.IList)) + public EffectiveNetworkSecurityGroup(SubResource networkSecurityGroup = default(SubResource), EffectiveNetworkSecurityGroupAssociation association = default(EffectiveNetworkSecurityGroupAssociation), IList effectiveSecurityRules = default(IList)) { NetworkSecurityGroup = networkSecurityGroup; Association = association; @@ -39,19 +45,20 @@ public EffectiveNetworkSecurityGroup() { } /// /// Gets or sets the ID of network security group that is applied. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "networkSecurityGroup")] + [JsonProperty(PropertyName = "networkSecurityGroup")] public SubResource NetworkSecurityGroup { get; set; } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "association")] + [JsonProperty(PropertyName = "association")] public EffectiveNetworkSecurityGroupAssociation Association { get; set; } /// /// Gets or sets a collection of effective security rules. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "effectiveSecurityRules")] - public System.Collections.Generic.IList EffectiveSecurityRules { get; set; } + [JsonProperty(PropertyName = "effectiveSecurityRules")] + public IList EffectiveSecurityRules { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs index 4a6b4529e1e31..f8a1c05786675 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; using System.Linq; /// @@ -37,14 +41,15 @@ public EffectiveNetworkSecurityGroupAssociation() { } /// /// Gets or sets the ID of the subnet if assigned. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] + [JsonProperty(PropertyName = "subnet")] public SubResource Subnet { get; set; } /// /// Gets or sets the ID of the network interface if assigned. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "networkInterface")] + [JsonProperty(PropertyName = "networkInterface")] public SubResource NetworkInterface { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupListResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupListResult.cs index 6428968dfe4cb..7231595d76d18 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupListResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupListResult.cs @@ -1,13 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -29,7 +35,7 @@ public EffectiveNetworkSecurityGroupListResult() { } /// groups. /// The URL to get the next set of /// results. - public EffectiveNetworkSecurityGroupListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) + public EffectiveNetworkSecurityGroupListResult(IList value = default(IList), string nextLink = default(string)) { Value = value; NextLink = nextLink; @@ -38,14 +44,15 @@ public EffectiveNetworkSecurityGroupListResult() { } /// /// Gets or sets a list of effective network security groups. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "value")] - public System.Collections.Generic.IList Value { get; set; } + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } /// /// Gets or sets the URL to get the next set of results. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + [JsonProperty(PropertyName = "nextLink")] public string NextLink { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityRule.cs index da1d6a753a5a2..887580cdda48b 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityRule.cs @@ -1,13 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -39,8 +45,8 @@ public EffectiveNetworkSecurityRule() { } /// prefix. /// The expanded source /// address prefix. - /// Expanded - /// destination address prefix. + /// Expanded destination + /// address prefix. /// Whether network traffic is allowed or denied. /// Possible values are: 'Allow' and 'Deny'. Possible values include: /// 'Allow', 'Deny' @@ -48,7 +54,7 @@ public EffectiveNetworkSecurityRule() { } /// The direction of the rule. Possible values /// are: 'Inbound and Outbound'. Possible values include: 'Inbound', /// 'Outbound' - public EffectiveNetworkSecurityRule(string name = default(string), string protocol = default(string), string sourcePortRange = default(string), string destinationPortRange = default(string), string sourceAddressPrefix = default(string), string destinationAddressPrefix = default(string), System.Collections.Generic.IList expandedSourceAddressPrefix = default(System.Collections.Generic.IList), System.Collections.Generic.IList expandedDestinationAddressPrefix = default(System.Collections.Generic.IList), string access = default(string), int? priority = default(int?), string direction = default(string)) + public EffectiveNetworkSecurityRule(string name = default(string), string protocol = default(string), string sourcePortRange = default(string), string destinationPortRange = default(string), string sourceAddressPrefix = default(string), string destinationAddressPrefix = default(string), IList expandedSourceAddressPrefix = default(IList), IList expandedDestinationAddressPrefix = default(IList), string access = default(string), int? priority = default(int?), string direction = default(string)) { Name = name; Protocol = protocol; @@ -67,65 +73,65 @@ public EffectiveNetworkSecurityRule() { } /// Gets or sets the name of the security rule specified by the user /// (if created by the user). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets the network protocol this rule applies to. Possible - /// values are: 'Tcp', 'Udp', and '*'. Possible values include: - /// 'Tcp', 'Udp', '*' + /// values are: 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', + /// 'Udp', '*' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + [JsonProperty(PropertyName = "protocol")] public string Protocol { get; set; } /// /// Gets or sets the source port or range. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "sourcePortRange")] + [JsonProperty(PropertyName = "sourcePortRange")] public string SourcePortRange { get; set; } /// /// Gets or sets the destination port or range. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPortRange")] + [JsonProperty(PropertyName = "destinationPortRange")] public string DestinationPortRange { get; set; } /// /// Gets or sets the source address prefix. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "sourceAddressPrefix")] + [JsonProperty(PropertyName = "sourceAddressPrefix")] public string SourceAddressPrefix { get; set; } /// /// Gets or sets the destination address prefix. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "destinationAddressPrefix")] + [JsonProperty(PropertyName = "destinationAddressPrefix")] public string DestinationAddressPrefix { get; set; } /// /// Gets or sets the expanded source address prefix. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "expandedSourceAddressPrefix")] - public System.Collections.Generic.IList ExpandedSourceAddressPrefix { get; set; } + [JsonProperty(PropertyName = "expandedSourceAddressPrefix")] + public IList ExpandedSourceAddressPrefix { get; set; } /// /// Gets or sets expanded destination address prefix. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "expandedDestinationAddressPrefix")] - public System.Collections.Generic.IList ExpandedDestinationAddressPrefix { get; set; } + [JsonProperty(PropertyName = "expandedDestinationAddressPrefix")] + public IList ExpandedDestinationAddressPrefix { get; set; } /// - /// Gets or sets whether network traffic is allowed or denied. - /// Possible values are: 'Allow' and 'Deny'. Possible values include: - /// 'Allow', 'Deny' + /// Gets or sets whether network traffic is allowed or denied. Possible + /// values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + /// 'Deny' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "access")] + [JsonProperty(PropertyName = "access")] public string Access { get; set; } /// /// Gets or sets the priority of the rule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + [JsonProperty(PropertyName = "priority")] public int? Priority { get; set; } /// @@ -133,8 +139,9 @@ public EffectiveNetworkSecurityRule() { } /// 'Inbound and Outbound'. Possible values include: 'Inbound', /// 'Outbound' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "direction")] + [JsonProperty(PropertyName = "direction")] public string Direction { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRoute.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRoute.cs index 92d1ceb387bcf..386d8f5dd28e1 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRoute.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRoute.cs @@ -1,13 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -26,9 +32,9 @@ public EffectiveRoute() { } /// The name of the user defined route. This is /// optional. /// Who created the route. Possible values are: - /// 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. - /// Possible values include: 'Unknown', 'User', - /// 'VirtualNetworkGateway', 'Default' + /// 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. Possible + /// values include: 'Unknown', 'User', 'VirtualNetworkGateway', + /// 'Default' /// The value of effective route. Possible values /// are: 'Active' and 'Invalid'. Possible values include: 'Active', /// 'Invalid' @@ -41,7 +47,7 @@ public EffectiveRoute() { } /// 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible /// values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', /// 'VirtualAppliance', 'None' - public EffectiveRoute(string name = default(string), string source = default(string), string state = default(string), System.Collections.Generic.IList addressPrefix = default(System.Collections.Generic.IList), System.Collections.Generic.IList nextHopIpAddress = default(System.Collections.Generic.IList), string nextHopType = default(string)) + public EffectiveRoute(string name = default(string), string source = default(string), string state = default(string), IList addressPrefix = default(IList), IList nextHopIpAddress = default(IList), string nextHopType = default(string)) { Name = name; Source = source; @@ -54,16 +60,15 @@ public EffectiveRoute() { } /// /// Gets or sets the name of the user defined route. This is optional. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// Gets or sets who created the route. Possible values are: - /// 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. - /// Possible values include: 'Unknown', 'User', - /// 'VirtualNetworkGateway', 'Default' + /// Gets or sets who created the route. Possible values are: 'Unknown', + /// 'User', 'VirtualNetworkGateway', and 'Default'. Possible values + /// include: 'Unknown', 'User', 'VirtualNetworkGateway', 'Default' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "source")] + [JsonProperty(PropertyName = "source")] public string Source { get; set; } /// @@ -71,21 +76,21 @@ public EffectiveRoute() { } /// 'Active' and 'Invalid'. Possible values include: 'Active', /// 'Invalid' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + [JsonProperty(PropertyName = "state")] public string State { get; set; } /// /// Gets or sets the address prefixes of the effective routes in CIDR /// notation. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "addressPrefix")] - public System.Collections.Generic.IList AddressPrefix { get; set; } + [JsonProperty(PropertyName = "addressPrefix")] + public IList AddressPrefix { get; set; } /// /// Gets or sets the IP address of the next hop of the effective route. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nextHopIpAddress")] - public System.Collections.Generic.IList NextHopIpAddress { get; set; } + [JsonProperty(PropertyName = "nextHopIpAddress")] + public IList NextHopIpAddress { get; set; } /// /// Gets or sets the type of Azure hop the packet should be sent to. @@ -94,8 +99,9 @@ public EffectiveRoute() { } /// include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', /// 'VirtualAppliance', 'None' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nextHopType")] + [JsonProperty(PropertyName = "nextHopType")] public string NextHopType { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteListResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteListResult.cs index 6cf62a7c8da2d..b199d6b3416ac 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteListResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteListResult.cs @@ -1,13 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -26,7 +32,7 @@ public EffectiveRouteListResult() { } /// A list of effective routes. /// The URL to get the next set of /// results. - public EffectiveRouteListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) + public EffectiveRouteListResult(IList value = default(IList), string nextLink = default(string)) { Value = value; NextLink = nextLink; @@ -35,14 +41,15 @@ public EffectiveRouteListResult() { } /// /// Gets or sets a list of effective routes. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "value")] - public System.Collections.Generic.IList Value { get; set; } + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } /// /// Gets or sets the URL to get the next set of results. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + [JsonProperty(PropertyName = "nextLink")] public string NextLink { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteSource.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteSource.cs index ffe06b8cfc2e6..b18f6be707129 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteSource.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteSource.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for EffectiveRouteSource. @@ -20,3 +23,4 @@ public static class EffectiveRouteSource public const string Default = "Default"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteState.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteState.cs index 17a15ba93e93f..efe29040f987d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteState.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteState.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for EffectiveRouteState. @@ -18,3 +21,4 @@ public static class EffectiveRouteState public const string Invalid = "Invalid"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Error.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Error.cs index 83c7c158567da..96d02120f6b0f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Error.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Error.cs @@ -1,13 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; public partial class Error @@ -20,7 +26,7 @@ public Error() { } /// /// Initializes a new instance of the Error class. /// - public Error(string code = default(string), string message = default(string), string target = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList), string innerError = default(string)) + public Error(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), string innerError = default(string)) { Code = code; Message = message; @@ -31,28 +37,29 @@ public Error() { } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + [JsonProperty(PropertyName = "code")] public string Code { get; set; } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + [JsonProperty(PropertyName = "message")] public string Message { get; set; } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + [JsonProperty(PropertyName = "target")] public string Target { get; set; } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "details")] - public System.Collections.Generic.IList Details { get; set; } + [JsonProperty(PropertyName = "details")] + public IList Details { get; set; } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "innerError")] + [JsonProperty(PropertyName = "innerError")] public string InnerError { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ErrorDetails.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ErrorDetails.cs index b54e805168343..3191b4f350fd9 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ErrorDetails.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ErrorDetails.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; using System.Linq; public partial class ErrorDetails @@ -29,18 +33,19 @@ public ErrorDetails() { } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + [JsonProperty(PropertyName = "code")] public string Code { get; set; } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + [JsonProperty(PropertyName = "target")] public string Target { get; set; } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + [JsonProperty(PropertyName = "message")] public string Message { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuit.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuit.cs index cfcdf409d7d5c..b6fb752601e30 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuit.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuit.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// ExpressRouteCircuit resource /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class ExpressRouteCircuit : Resource { /// @@ -32,8 +40,8 @@ public ExpressRouteCircuit() { } /// The SKU. /// Allow classic /// operations - /// The - /// CircuitProvisioningState state of the resource. + /// The CircuitProvisioningState + /// state of the resource. /// The /// ServiceProviderProvisioningState state of the resource. Possible /// values are 'NotProvisioned', 'Provisioning', 'Provisioned', and @@ -52,7 +60,7 @@ public ExpressRouteCircuit() { } /// The GatewayManager Etag. /// Gets a unique read-only string that changes /// whenever the resource is updated. - public ExpressRouteCircuit(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ExpressRouteCircuitSku sku = default(ExpressRouteCircuitSku), bool? allowClassicOperations = default(bool?), string circuitProvisioningState = default(string), string serviceProviderProvisioningState = default(string), System.Collections.Generic.IList authorizations = default(System.Collections.Generic.IList), System.Collections.Generic.IList peerings = default(System.Collections.Generic.IList), string serviceKey = default(string), string serviceProviderNotes = default(string), ExpressRouteCircuitServiceProviderProperties serviceProviderProperties = default(ExpressRouteCircuitServiceProviderProperties), string provisioningState = default(string), string gatewayManagerEtag = default(string), string etag = default(string)) + public ExpressRouteCircuit(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExpressRouteCircuitSku sku = default(ExpressRouteCircuitSku), bool? allowClassicOperations = default(bool?), string circuitProvisioningState = default(string), string serviceProviderProvisioningState = default(string), IList authorizations = default(IList), IList peerings = default(IList), string serviceKey = default(string), string serviceProviderNotes = default(string), ExpressRouteCircuitServiceProviderProperties serviceProviderProperties = default(ExpressRouteCircuitServiceProviderProperties), string provisioningState = default(string), string gatewayManagerEtag = default(string), string etag = default(string)) : base(id, name, type, location, tags) { Sku = sku; @@ -72,19 +80,19 @@ public ExpressRouteCircuit() { } /// /// Gets or sets the SKU. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + [JsonProperty(PropertyName = "sku")] public ExpressRouteCircuitSku Sku { get; set; } /// /// Gets or sets allow classic operations /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowClassicOperations")] + [JsonProperty(PropertyName = "properties.allowClassicOperations")] public bool? AllowClassicOperations { get; set; } /// /// Gets or sets the CircuitProvisioningState state of the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.circuitProvisioningState")] + [JsonProperty(PropertyName = "properties.circuitProvisioningState")] public string CircuitProvisioningState { get; set; } /// @@ -93,58 +101,59 @@ public ExpressRouteCircuit() { } /// 'Provisioned', and 'Deprovisioning'. Possible values include: /// 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceProviderProvisioningState")] + [JsonProperty(PropertyName = "properties.serviceProviderProvisioningState")] public string ServiceProviderProvisioningState { get; set; } /// /// Gets or sets the list of authorizations. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authorizations")] - public System.Collections.Generic.IList Authorizations { get; set; } + [JsonProperty(PropertyName = "properties.authorizations")] + public IList Authorizations { get; set; } /// /// Gets or sets the list of peerings. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peerings")] - public System.Collections.Generic.IList Peerings { get; set; } + [JsonProperty(PropertyName = "properties.peerings")] + public IList Peerings { get; set; } /// /// Gets or sets the ServiceKey. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceKey")] + [JsonProperty(PropertyName = "properties.serviceKey")] public string ServiceKey { get; set; } /// /// Gets or sets the ServiceProviderNotes. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceProviderNotes")] + [JsonProperty(PropertyName = "properties.serviceProviderNotes")] public string ServiceProviderNotes { get; set; } /// /// Gets or sets the ServiceProviderProperties. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceProviderProperties")] + [JsonProperty(PropertyName = "properties.serviceProviderProperties")] public ExpressRouteCircuitServiceProviderProperties ServiceProviderProperties { get; set; } /// /// Gets the provisioning state of the public IP resource. Possible /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets the GatewayManager Etag. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayManagerEtag")] + [JsonProperty(PropertyName = "properties.gatewayManagerEtag")] public string GatewayManagerEtag { get; set; } /// /// Gets a unique read-only string that changes whenever the resource /// is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitArpTable.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitArpTable.cs index f2396d042f69a..86c032f1a7867 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitArpTable.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitArpTable.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; using System.Linq; /// @@ -40,26 +44,27 @@ public ExpressRouteCircuitArpTable() { } /// /// Gets or sets age /// - [Newtonsoft.Json.JsonProperty(PropertyName = "age")] + [JsonProperty(PropertyName = "age")] public int? Age { get; set; } /// /// Gets or sets interface /// - [Newtonsoft.Json.JsonProperty(PropertyName = "interface")] + [JsonProperty(PropertyName = "interface")] public string InterfaceProperty { get; set; } /// /// Gets or sets the IP address. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ipAddress")] + [JsonProperty(PropertyName = "ipAddress")] public string IpAddress { get; set; } /// /// Gets or sets the MAC address. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "macAddress")] + [JsonProperty(PropertyName = "macAddress")] public string MacAddress { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitAuthorization.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitAuthorization.cs index 07c4e43b03693..6ede41b3e1ed7 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitAuthorization.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitAuthorization.cs @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// Authorization in an ExpressRouteCircuit resource. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class ExpressRouteCircuitAuthorization : SubResource { /// @@ -52,7 +58,7 @@ public ExpressRouteCircuitAuthorization() { } /// /// Gets or sets the authorization key. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authorizationKey")] + [JsonProperty(PropertyName = "properties.authorizationKey")] public string AuthorizationKey { get; set; } /// @@ -60,29 +66,30 @@ public ExpressRouteCircuitAuthorization() { } /// 'Available' and 'InUse'. Possible values include: 'Available', /// 'InUse' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authorizationUseStatus")] + [JsonProperty(PropertyName = "properties.authorizationUseStatus")] public string AuthorizationUseStatus { get; set; } /// /// Gets the provisioning state of the public IP resource. Possible /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets name of the resource that is unique within a resource group. /// This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeering.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeering.cs index 308531ca95e70..8a7777209dca4 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeering.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeering.cs @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// Peering in an ExpressRouteCircuit resource. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class ExpressRouteCircuitPeering : SubResource { /// @@ -27,9 +33,8 @@ public ExpressRouteCircuitPeering() { } /// Resource ID. /// The PeeringType. Possible values are: /// 'AzurePublicPeering', 'AzurePrivatePeering', and - /// 'MicrosoftPeering'. Possible values include: - /// 'AzurePublicPeering', 'AzurePrivatePeering', - /// 'MicrosoftPeering' + /// 'MicrosoftPeering'. Possible values include: 'AzurePublicPeering', + /// 'AzurePrivatePeering', 'MicrosoftPeering' /// The state of peering. Possible values are: /// 'Disabled' and 'Enbaled'. Possible values include: 'Disabled', /// 'Enabled' @@ -82,112 +87,113 @@ public ExpressRouteCircuitPeering() { } /// /// Gets or sets the PeeringType. Possible values are: /// 'AzurePublicPeering', 'AzurePrivatePeering', and - /// 'MicrosoftPeering'. Possible values include: - /// 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + /// 'MicrosoftPeering'. Possible values include: 'AzurePublicPeering', + /// 'AzurePrivatePeering', 'MicrosoftPeering' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peeringType")] + [JsonProperty(PropertyName = "properties.peeringType")] public string PeeringType { get; set; } /// /// Gets or sets the state of peering. Possible values are: 'Disabled' /// and 'Enbaled'. Possible values include: 'Disabled', 'Enabled' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.state")] + [JsonProperty(PropertyName = "properties.state")] public string State { get; set; } /// /// Gets or sets the Azure ASN. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.azureASN")] + [JsonProperty(PropertyName = "properties.azureASN")] public int? AzureASN { get; set; } /// /// Gets or sets the peer ASN. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peerASN")] + [JsonProperty(PropertyName = "properties.peerASN")] public int? PeerASN { get; set; } /// /// Gets or sets the primary address prefix. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primaryPeerAddressPrefix")] + [JsonProperty(PropertyName = "properties.primaryPeerAddressPrefix")] public string PrimaryPeerAddressPrefix { get; set; } /// /// Gets or sets the secondary address prefix. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.secondaryPeerAddressPrefix")] + [JsonProperty(PropertyName = "properties.secondaryPeerAddressPrefix")] public string SecondaryPeerAddressPrefix { get; set; } /// /// Gets or sets the primary port. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primaryAzurePort")] + [JsonProperty(PropertyName = "properties.primaryAzurePort")] public string PrimaryAzurePort { get; set; } /// /// Gets or sets the secondary port. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.secondaryAzurePort")] + [JsonProperty(PropertyName = "properties.secondaryAzurePort")] public string SecondaryAzurePort { get; set; } /// /// Gets or sets the shared key. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sharedKey")] + [JsonProperty(PropertyName = "properties.sharedKey")] public string SharedKey { get; set; } /// /// Gets or sets the VLAN ID. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vlanId")] + [JsonProperty(PropertyName = "properties.vlanId")] public int? VlanId { get; set; } /// /// Gets or sets the Microsoft peering configuration. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.microsoftPeeringConfig")] + [JsonProperty(PropertyName = "properties.microsoftPeeringConfig")] public ExpressRouteCircuitPeeringConfig MicrosoftPeeringConfig { get; set; } /// /// Gets peering stats. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.stats")] + [JsonProperty(PropertyName = "properties.stats")] public ExpressRouteCircuitStats Stats { get; set; } /// /// Gets the provisioning state of the public IP resource. Possible /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets the GatewayManager Etag. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayManagerEtag")] + [JsonProperty(PropertyName = "properties.gatewayManagerEtag")] public string GatewayManagerEtag { get; set; } /// /// Gets whether the provider or the customer last modified the /// peering. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.lastModifiedBy")] + [JsonProperty(PropertyName = "properties.lastModifiedBy")] public string LastModifiedBy { get; set; } /// /// Gets name of the resource that is unique within a resource group. /// This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.cs index 0814213900ddf..582e721e1e54d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for @@ -21,3 +24,4 @@ public static class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState public const string ValidationNeeded = "ValidationNeeded"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringConfig.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringConfig.cs index 9e12cf1fafe97..7a1858827dc34 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringConfig.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringConfig.cs @@ -1,13 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -28,15 +34,15 @@ public ExpressRouteCircuitPeeringConfig() { } /// The reference of /// AdvertisedPublicPrefixes. /// AdvertisedPublicPrefixState - /// of the Peering resource. Possible values are 'NotConfigured', + /// name="advertisedPublicPrefixesState">AdvertisedPublicPrefixState of + /// the Peering resource. Possible values are 'NotConfigured', /// 'Configuring', 'Configured', and 'ValidationNeeded'. Possible /// values include: 'NotConfigured', 'Configuring', 'Configured', /// 'ValidationNeeded' /// The CustomerASN of the peering. /// The RoutingRegistryName of the /// configuration. - public ExpressRouteCircuitPeeringConfig(System.Collections.Generic.IList advertisedPublicPrefixes = default(System.Collections.Generic.IList), string advertisedPublicPrefixesState = default(string), int? customerASN = default(int?), string routingRegistryName = default(string)) + public ExpressRouteCircuitPeeringConfig(IList advertisedPublicPrefixes = default(IList), string advertisedPublicPrefixesState = default(string), int? customerASN = default(int?), string routingRegistryName = default(string)) { AdvertisedPublicPrefixes = advertisedPublicPrefixes; AdvertisedPublicPrefixesState = advertisedPublicPrefixesState; @@ -47,8 +53,8 @@ public ExpressRouteCircuitPeeringConfig() { } /// /// Gets or sets the reference of AdvertisedPublicPrefixes. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "advertisedPublicPrefixes")] - public System.Collections.Generic.IList AdvertisedPublicPrefixes { get; set; } + [JsonProperty(PropertyName = "advertisedPublicPrefixes")] + public IList AdvertisedPublicPrefixes { get; set; } /// /// Gets or sets advertisedPublicPrefixState of the Peering resource. @@ -56,20 +62,21 @@ public ExpressRouteCircuitPeeringConfig() { } /// and 'ValidationNeeded'. Possible values include: 'NotConfigured', /// 'Configuring', 'Configured', 'ValidationNeeded' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "advertisedPublicPrefixesState")] + [JsonProperty(PropertyName = "advertisedPublicPrefixesState")] public string AdvertisedPublicPrefixesState { get; set; } /// /// Gets or sets the CustomerASN of the peering. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "customerASN")] + [JsonProperty(PropertyName = "customerASN")] public int? CustomerASN { get; set; } /// /// Gets or sets the RoutingRegistryName of the configuration. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "routingRegistryName")] + [JsonProperty(PropertyName = "routingRegistryName")] public string RoutingRegistryName { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringState.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringState.cs index aaa83a36de6bb..e1a0518e98d7e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringState.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringState.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for ExpressRouteCircuitPeeringState. @@ -18,3 +21,4 @@ public static class ExpressRouteCircuitPeeringState public const string Enabled = "Enabled"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringType.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringType.cs index 1fd205803da3a..f48709b1b17d0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringType.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringType.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for ExpressRouteCircuitPeeringType. @@ -19,3 +22,4 @@ public static class ExpressRouteCircuitPeeringType public const string MicrosoftPeering = "MicrosoftPeering"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTable.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTable.cs index c098df1980188..914591760cea6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTable.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTable.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; using System.Linq; /// @@ -42,32 +46,33 @@ public ExpressRouteCircuitRoutesTable() { } /// /// Gets or sets network /// - [Newtonsoft.Json.JsonProperty(PropertyName = "network")] + [JsonProperty(PropertyName = "network")] public string Network { get; set; } /// /// Gets or sets nextHop /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nextHop")] + [JsonProperty(PropertyName = "nextHop")] public string NextHop { get; set; } /// /// Gets or sets locPrf /// - [Newtonsoft.Json.JsonProperty(PropertyName = "locPrf")] + [JsonProperty(PropertyName = "locPrf")] public string LocPrf { get; set; } /// /// Gets or sets weight. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "weight")] + [JsonProperty(PropertyName = "weight")] public int? Weight { get; set; } /// /// Gets or sets path /// - [Newtonsoft.Json.JsonProperty(PropertyName = "path")] + [JsonProperty(PropertyName = "path")] public string Path { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTableSummary.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTableSummary.cs index 339391a019fd5..7d633e9989141 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTableSummary.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTableSummary.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +33,11 @@ public ExpressRouteCircuitRoutesTableSummary() { } /// BGP version number spoken to the neighbor. /// Autonomous system number. /// The length of time that the BGP session has - /// been in the Established state, or the current status if not in - /// the Established state. - /// Current state of the BGP session, and - /// the number of prefixes that have been received from a neighbor or - /// peer group. + /// been in the Established state, or the current status if not in the + /// Established state. + /// Current state of the BGP session, and the + /// number of prefixes that have been received from a neighbor or peer + /// group. public ExpressRouteCircuitRoutesTableSummary(string neighbor = default(string), int? v = default(int?), int? asProperty = default(int?), string upDown = default(string), string statePfxRcd = default(string)) { Neighbor = neighbor; @@ -46,19 +50,19 @@ public ExpressRouteCircuitRoutesTableSummary() { } /// /// Gets or sets neighbor /// - [Newtonsoft.Json.JsonProperty(PropertyName = "neighbor")] + [JsonProperty(PropertyName = "neighbor")] public string Neighbor { get; set; } /// /// Gets or sets BGP version number spoken to the neighbor. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "v")] + [JsonProperty(PropertyName = "v")] public int? V { get; set; } /// /// Gets or sets autonomous system number. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "as")] + [JsonProperty(PropertyName = "as")] public int? AsProperty { get; set; } /// @@ -66,15 +70,16 @@ public ExpressRouteCircuitRoutesTableSummary() { } /// the Established state, or the current status if not in the /// Established state. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "upDown")] + [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. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "statePfxRcd")] + [JsonProperty(PropertyName = "statePfxRcd")] public string StatePfxRcd { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitServiceProviderProperties.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitServiceProviderProperties.cs index 5fefca6a5d149..47cbbdb608cdf 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitServiceProviderProperties.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitServiceProviderProperties.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; using System.Linq; /// @@ -38,20 +42,21 @@ public ExpressRouteCircuitServiceProviderProperties() { } /// /// Gets or sets the serviceProviderName. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "serviceProviderName")] + [JsonProperty(PropertyName = "serviceProviderName")] public string ServiceProviderName { get; set; } /// /// Gets or sets the peering location. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "peeringLocation")] + [JsonProperty(PropertyName = "peeringLocation")] public string PeeringLocation { get; set; } /// /// Gets or sets the BandwidthInMbps. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "bandwidthInMbps")] + [JsonProperty(PropertyName = "bandwidthInMbps")] public int? BandwidthInMbps { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSku.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSku.cs index 1a626cda0291b..a03f6b61511f2 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSku.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSku.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; using System.Linq; /// @@ -40,14 +44,14 @@ public ExpressRouteCircuitSku() { } /// /// Gets or sets the name of the SKU. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets the tier of the SKU. Possible values are 'Standard' /// and 'Premium'. Possible values include: 'Standard', 'Premium' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + [JsonProperty(PropertyName = "tier")] public string Tier { get; set; } /// @@ -55,8 +59,9 @@ public ExpressRouteCircuitSku() { } /// 'UnlimitedData' and 'MeteredData'. Possible values include: /// 'UnlimitedData', 'MeteredData' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "family")] + [JsonProperty(PropertyName = "family")] public string Family { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuFamily.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuFamily.cs index 2d76ac674a067..37da3f35d382f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuFamily.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuFamily.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for ExpressRouteCircuitSkuFamily. @@ -18,3 +21,4 @@ public static class ExpressRouteCircuitSkuFamily public const string MeteredData = "MeteredData"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuTier.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuTier.cs index 0c32ebcf3ddf9..67a63c5ee3db9 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuTier.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuTier.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for ExpressRouteCircuitSkuTier. @@ -18,3 +21,4 @@ public static class ExpressRouteCircuitSkuTier public const string Premium = "Premium"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitStats.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitStats.cs index b727de0d17368..74e2a7ffaa946 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitStats.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitStats.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; using System.Linq; /// @@ -39,26 +43,27 @@ public ExpressRouteCircuitStats() { } /// /// Gets BytesIn of the peering. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "primarybytesIn")] + [JsonProperty(PropertyName = "primarybytesIn")] public long? PrimarybytesIn { get; set; } /// /// Gets BytesOut of the peering. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "primarybytesOut")] + [JsonProperty(PropertyName = "primarybytesOut")] public long? PrimarybytesOut { get; set; } /// /// Gets BytesIn of the peering. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "secondarybytesIn")] + [JsonProperty(PropertyName = "secondarybytesIn")] public long? SecondarybytesIn { get; set; } /// /// Gets BytesOut of the peering. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "secondarybytesOut")] + [JsonProperty(PropertyName = "secondarybytesOut")] public long? SecondarybytesOut { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsArpTableListResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsArpTableListResult.cs index 3dd5e554d5214..e0975b0e53b01 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsArpTableListResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsArpTableListResult.cs @@ -1,13 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -29,7 +35,7 @@ public ExpressRouteCircuitsArpTableListResult() { } /// Gets list of the ARP table. /// The URL to get the next set of /// results. - public ExpressRouteCircuitsArpTableListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) + public ExpressRouteCircuitsArpTableListResult(IList value = default(IList), string nextLink = default(string)) { Value = value; NextLink = nextLink; @@ -38,14 +44,15 @@ public ExpressRouteCircuitsArpTableListResult() { } /// /// Gets list of the ARP table. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "value")] - public System.Collections.Generic.IList Value { get; set; } + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } /// /// Gets or sets the URL to get the next set of results. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + [JsonProperty(PropertyName = "nextLink")] public string NextLink { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableListResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableListResult.cs index 299fe780d8781..05c7af405a1ba 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableListResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableListResult.cs @@ -1,18 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// - /// Response for ListRoutesTable associated with the Express Route - /// Circuits API. + /// Response for ListRoutesTable associated with the Express Route Circuits + /// API. /// public partial class ExpressRouteCircuitsRoutesTableListResult { @@ -29,7 +35,7 @@ public ExpressRouteCircuitsRoutesTableListResult() { } /// The list of routes table. /// The URL to get the next set of /// results. - public ExpressRouteCircuitsRoutesTableListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) + public ExpressRouteCircuitsRoutesTableListResult(IList value = default(IList), string nextLink = default(string)) { Value = value; NextLink = nextLink; @@ -38,14 +44,15 @@ public ExpressRouteCircuitsRoutesTableListResult() { } /// /// Gets or sets the list of routes table. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "value")] - public System.Collections.Generic.IList Value { get; set; } + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } /// /// Gets or sets the URL to get the next set of results. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + [JsonProperty(PropertyName = "nextLink")] public string NextLink { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableSummaryListResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableSummaryListResult.cs index 5d58ebe5a3b73..4e40d46f9ae39 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableSummaryListResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableSummaryListResult.cs @@ -1,18 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// - /// Response for ListRoutesTable associated with the Express Route - /// Circuits API. + /// Response for ListRoutesTable associated with the Express Route Circuits + /// API. /// public partial class ExpressRouteCircuitsRoutesTableSummaryListResult { @@ -29,7 +35,7 @@ public ExpressRouteCircuitsRoutesTableSummaryListResult() { } /// A list of the routes table. /// The URL to get the next set of /// results. - public ExpressRouteCircuitsRoutesTableSummaryListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) + public ExpressRouteCircuitsRoutesTableSummaryListResult(IList value = default(IList), string nextLink = default(string)) { Value = value; NextLink = nextLink; @@ -38,14 +44,15 @@ public ExpressRouteCircuitsRoutesTableSummaryListResult() { } /// /// Gets or sets a list of the routes table. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "value")] - public System.Collections.Generic.IList Value { get; set; } + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } /// /// Gets or sets the URL to get the next set of results. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + [JsonProperty(PropertyName = "nextLink")] public string NextLink { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProvider.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProvider.cs index ede85286d9498..6b517df75aea5 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProvider.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProvider.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// A ExpressRouteResourceProvider object. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class ExpressRouteServiceProvider : Resource { /// @@ -36,7 +44,7 @@ public ExpressRouteServiceProvider() { } /// Gets bandwidths offered. /// Gets the provisioning state of the /// resource. - public ExpressRouteServiceProvider(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList peeringLocations = default(System.Collections.Generic.IList), System.Collections.Generic.IList bandwidthsOffered = default(System.Collections.Generic.IList), string provisioningState = default(string)) + public ExpressRouteServiceProvider(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList peeringLocations = default(IList), IList bandwidthsOffered = default(IList), string provisioningState = default(string)) : base(id, name, type, location, tags) { PeeringLocations = peeringLocations; @@ -47,20 +55,21 @@ public ExpressRouteServiceProvider() { } /// /// Gets or sets get a list of peering locations. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peeringLocations")] - public System.Collections.Generic.IList PeeringLocations { get; set; } + [JsonProperty(PropertyName = "properties.peeringLocations")] + public IList PeeringLocations { get; set; } /// /// Gets bandwidths offered. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bandwidthsOffered")] - public System.Collections.Generic.IList BandwidthsOffered { get; set; } + [JsonProperty(PropertyName = "properties.bandwidthsOffered")] + public IList BandwidthsOffered { get; set; } /// /// Gets the provisioning state of the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProviderBandwidthsOffered.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProviderBandwidthsOffered.cs index aefa8e074442e..f8a1a744bd7f8 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProviderBandwidthsOffered.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProviderBandwidthsOffered.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; using System.Linq; /// @@ -36,14 +40,15 @@ public ExpressRouteServiceProviderBandwidthsOffered() { } /// /// Gets or sets the OfferName. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "offerName")] + [JsonProperty(PropertyName = "offerName")] public string OfferName { get; set; } /// /// Gets or sets the ValueInMbps. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "valueInMbps")] + [JsonProperty(PropertyName = "valueInMbps")] public int? ValueInMbps { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/FrontendIpConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/FrontendIpConfiguration.cs index 73f9b906b98c0..19cc79dce0f51 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/FrontendIpConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/FrontendIpConfiguration.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Frontend IP address of the load balancer. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class FrontendIPConfiguration : SubResource { /// @@ -44,12 +52,12 @@ public FrontendIPConfiguration() { } /// Gets the provisioning state of the /// public IP resource. Possible values are: 'Updating', 'Deleting', /// and 'Failed'. - /// The name of the resource that is unique within - /// a resource group. This name can be used to access the + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the /// resource. /// A unique read-only string that changes whenever /// the resource is updated. - public FrontendIPConfiguration(string id = default(string), System.Collections.Generic.IList inboundNatRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList inboundNatPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList outboundNatRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancingRules = default(System.Collections.Generic.IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), Subnet subnet = default(Subnet), PublicIPAddress publicIPAddress = default(PublicIPAddress), string provisioningState = default(string), string name = default(string), string etag = default(string)) + public FrontendIPConfiguration(string id = default(string), IList inboundNatRules = default(IList), IList inboundNatPools = default(IList), IList outboundNatRules = default(IList), IList loadBalancingRules = default(IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), Subnet subnet = default(Subnet), PublicIPAddress publicIPAddress = default(PublicIPAddress), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { InboundNatRules = inboundNatRules; @@ -68,73 +76,74 @@ public FrontendIPConfiguration() { } /// /// Gets read only. Inbound rules URIs that use this frontend IP. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.inboundNatRules")] - public System.Collections.Generic.IList InboundNatRules { get; private set; } + [JsonProperty(PropertyName = "properties.inboundNatRules")] + public IList InboundNatRules { get; protected set; } /// /// Gets read only. Inbound pools URIs that use this frontend IP. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.inboundNatPools")] - public System.Collections.Generic.IList InboundNatPools { get; private set; } + [JsonProperty(PropertyName = "properties.inboundNatPools")] + public IList InboundNatPools { get; protected set; } /// /// Gets read only. Outbound rules URIs that use this frontend IP. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.outboundNatRules")] - public System.Collections.Generic.IList OutboundNatRules { get; private set; } + [JsonProperty(PropertyName = "properties.outboundNatRules")] + public IList OutboundNatRules { get; protected set; } /// /// Gets load balancing rules URIs that use this frontend IP. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancingRules")] - public System.Collections.Generic.IList LoadBalancingRules { get; private set; } + [JsonProperty(PropertyName = "properties.loadBalancingRules")] + public IList LoadBalancingRules { get; protected set; } /// /// Gets or sets the private IP address of the IP configuration. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddress")] + [JsonProperty(PropertyName = "properties.privateIPAddress")] public string PrivateIPAddress { get; set; } /// - /// Gets or sets the Private IP allocation method. Possible values - /// are: 'Static' and 'Dynamic'. Possible values include: 'Static', + /// Gets or sets the Private IP allocation method. Possible values are: + /// 'Static' and 'Dynamic'. Possible values include: 'Static', /// 'Dynamic' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] + [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] public string PrivateIPAllocationMethod { get; set; } /// /// Gets or sets the reference of the subnet resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + [JsonProperty(PropertyName = "properties.subnet")] public Subnet Subnet { get; set; } /// /// Gets or sets the reference of the Public IP resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddress")] + [JsonProperty(PropertyName = "properties.publicIPAddress")] public PublicIPAddress PublicIPAddress { get; set; } /// /// Gets the provisioning state of the public IP resource. Possible /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets the name of the resource that is unique within a /// resource group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPAddressAvailabilityResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPAddressAvailabilityResult.cs index 497c794f358b5..518d5bb3535dc 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPAddressAvailabilityResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPAddressAvailabilityResult.cs @@ -1,13 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -26,9 +32,9 @@ public IPAddressAvailabilityResult() { } /// class. /// /// Private IP address availability. - /// Contains other available - /// private IP addresses if the asked for address is taken. - public IPAddressAvailabilityResult(bool? available = default(bool?), System.Collections.Generic.IList availableIPAddresses = default(System.Collections.Generic.IList)) + /// Contains other available private + /// IP addresses if the asked for address is taken. + public IPAddressAvailabilityResult(bool? available = default(bool?), IList availableIPAddresses = default(IList)) { Available = available; AvailableIPAddresses = availableIPAddresses; @@ -37,15 +43,16 @@ public IPAddressAvailabilityResult() { } /// /// Gets or sets private IP address availability. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "available")] + [JsonProperty(PropertyName = "available")] public bool? Available { get; set; } /// /// Gets or sets contains other available private IP addresses if the /// asked for address is taken. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "availableIPAddresses")] - public System.Collections.Generic.IList AvailableIPAddresses { get; set; } + [JsonProperty(PropertyName = "availableIPAddresses")] + public IList AvailableIPAddresses { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPConfiguration.cs index 5bc56ffab53f6..fb80c5bef36f4 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPConfiguration.cs @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// IPConfiguration /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class IPConfiguration : SubResource { /// @@ -28,16 +34,16 @@ public IPConfiguration() { } /// The private IP address of the IP /// configuration. /// The private IP allocation - /// method. Possible values are 'Static' and 'Dynamic'. Possible - /// values include: 'Static', 'Dynamic' + /// method. Possible values are 'Static' and 'Dynamic'. Possible values + /// include: 'Static', 'Dynamic' /// The reference of the subnet resource. /// The reference of the public IP /// resource. /// Gets the provisioning state of the /// public IP resource. Possible values are: 'Updating', 'Deleting', /// and 'Failed'. - /// The name of the resource that is unique within - /// a resource group. This name can be used to access the + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the /// resource. /// A unique read-only string that changes whenever /// the resource is updated. @@ -56,7 +62,7 @@ public IPConfiguration() { } /// /// Gets or sets the private IP address of the IP configuration. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddress")] + [JsonProperty(PropertyName = "properties.privateIPAddress")] public string PrivateIPAddress { get; set; } /// @@ -64,41 +70,42 @@ public IPConfiguration() { } /// 'Static' and 'Dynamic'. Possible values include: 'Static', /// 'Dynamic' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] + [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] public string PrivateIPAllocationMethod { get; set; } /// /// Gets or sets the reference of the subnet resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + [JsonProperty(PropertyName = "properties.subnet")] public Subnet Subnet { get; set; } /// /// Gets or sets the reference of the public IP resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddress")] + [JsonProperty(PropertyName = "properties.publicIPAddress")] public PublicIPAddress PublicIPAddress { get; set; } /// /// Gets the provisioning state of the public IP resource. Possible /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets the name of the resource that is unique within a /// resource group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPVersion.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPVersion.cs index 675411474f4b3..d008da6d80000 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPVersion.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPVersion.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for IPVersion. @@ -18,3 +21,4 @@ public static class IPVersion public const string IPv6 = "IPv6"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatPool.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatPool.cs index b4f90e15e89a4..a3565fe07601d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatPool.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatPool.cs @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// Inbound NAT pool of the load balancer. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class InboundNatPool : SubResource { /// @@ -28,24 +34,23 @@ public InboundNatPool() { } /// Possible values are: 'Udp' or 'Tcp'. Possible values include: /// 'Udp', 'Tcp' /// The first port number in the - /// range of external ports that will be used to provide Inbound Nat - /// to NICs associated with a load balancer. Acceptable values range + /// range of external ports that will be used to provide Inbound Nat to + /// NICs associated with a load balancer. Acceptable values range /// between 1 and 65534. /// The last port number in the - /// range of external ports that will be used to provide Inbound Nat - /// to NICs associated with a load balancer. Acceptable values range + /// range of external ports that will be used to provide Inbound Nat to + /// NICs associated with a load balancer. Acceptable values range /// between 1 and 65535. - /// The port used for internal connections - /// on the endpoint. Acceptable values are between 1 and - /// 65535. + /// The port used for internal connections on + /// the endpoint. Acceptable values are between 1 and 65535. /// Resource ID. /// A reference to frontend IP /// addresses. /// Gets the provisioning state of the - /// PublicIP resource. Possible values are: 'Updating', 'Deleting', - /// and 'Failed'. - /// The name of the resource that is unique within - /// a resource group. This name can be used to access the + /// PublicIP resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the /// resource. /// A unique read-only string that changes whenever /// the resource is updated. @@ -65,72 +70,73 @@ public InboundNatPool() { } /// /// Gets or sets a reference to frontend IP addresses. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfiguration")] + [JsonProperty(PropertyName = "properties.frontendIPConfiguration")] public SubResource FrontendIPConfiguration { get; set; } /// /// Gets or sets the transport protocol for the endpoint. Possible /// values are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + [JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// /// Gets or sets the first port number in the range of external ports - /// that will be used to provide Inbound Nat to NICs associated with - /// a load balancer. Acceptable values range between 1 and 65534. + /// that will be used to provide Inbound Nat to NICs associated with a + /// load balancer. Acceptable values range between 1 and 65534. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPortRangeStart")] + [JsonProperty(PropertyName = "properties.frontendPortRangeStart")] public int FrontendPortRangeStart { get; set; } /// /// Gets or sets the last port number in the range of external ports - /// that will be used to provide Inbound Nat to NICs associated with - /// a load balancer. Acceptable values range between 1 and 65535. + /// that will be used to provide Inbound Nat to NICs associated with a + /// load balancer. Acceptable values range between 1 and 65535. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPortRangeEnd")] + [JsonProperty(PropertyName = "properties.frontendPortRangeEnd")] public int FrontendPortRangeEnd { get; set; } /// /// Gets or sets the port used for internal connections on the /// endpoint. Acceptable values are between 1 and 65535. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendPort")] + [JsonProperty(PropertyName = "properties.backendPort")] public int BackendPort { get; set; } /// /// Gets the provisioning state of the PublicIP resource. Possible /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets the name of the resource that is unique within a /// resource group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (Protocol == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Protocol"); + throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatRule.cs index 75d2f0b50fcc2..2728fc967c549 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatRule.cs @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// Inbound NAT rule of the load balancer. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class InboundNatRule : SubResource { /// @@ -28,15 +34,15 @@ public InboundNatRule() { } /// A reference to frontend IP /// addresses. /// A reference to a private IP - /// address defined on a network interface of a VM. Traffic sent to - /// the frontend port of each of the frontend IP configurations is + /// address defined on a network interface of a VM. Traffic sent to the + /// frontend port of each of the frontend IP configurations is /// forwarded to the backed IP. /// The transport protocol for the endpoint. /// Possible values are: 'Udp' or 'Tcp'. Possible values include: /// 'Udp', 'Tcp' - /// The port for the external endpoint. - /// Port numbers for each Rule must be unique within the Load - /// Balancer. Acceptable values range from 1 to 65534. + /// The port for the external endpoint. Port + /// numbers for each Rule must be unique within the Load Balancer. + /// Acceptable values range from 1 to 65534. /// The port used for the internal endpoint. /// Acceptable values range from 1 to 65535. /// The timeout for the TCP idle @@ -44,10 +50,10 @@ public InboundNatRule() { } /// default value is 4 minutes. This element is only used when the /// protocol is set to TCP. /// Configures a virtual machine's - /// endpoint for the floating IP capability required to configure a - /// SQL AlwaysOn Availability Group. This setting is required when - /// using the SQL AlwaysOn Availability Groups in SQL server. This - /// setting can't be changed after you create the endpoint. + /// endpoint for the floating IP capability required to configure a SQL + /// AlwaysOn Availability Group. This setting is required when using + /// the SQL AlwaysOn Availability Groups in SQL server. This setting + /// can't be changed after you create the endpoint. /// Gets the provisioning state of the /// public IP resource. Possible values are: 'Updating', 'Deleting', /// and 'Failed'. @@ -74,22 +80,22 @@ public InboundNatRule() { } /// /// Gets or sets a reference to frontend IP addresses. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfiguration")] + [JsonProperty(PropertyName = "properties.frontendIPConfiguration")] public SubResource FrontendIPConfiguration { get; set; } /// /// Gets a reference to a private IP address defined on a network - /// interface of a VM. Traffic sent to the frontend port of each of - /// the frontend IP configurations is forwarded to the backed IP. + /// interface of a VM. Traffic sent to the frontend port of each of the + /// frontend IP configurations is forwarded to the backed IP. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendIPConfiguration")] - public NetworkInterfaceIPConfiguration BackendIPConfiguration { get; private set; } + [JsonProperty(PropertyName = "properties.backendIPConfiguration")] + public NetworkInterfaceIPConfiguration BackendIPConfiguration { get; protected set; } /// /// Gets or sets the transport protocol for the endpoint. Possible /// values are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + [JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// @@ -97,23 +103,22 @@ public InboundNatRule() { } /// each Rule must be unique within the Load Balancer. Acceptable /// values range from 1 to 65534. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPort")] + [JsonProperty(PropertyName = "properties.frontendPort")] public int? FrontendPort { get; set; } /// /// Gets or sets the port used for the internal endpoint. Acceptable /// values range from 1 to 65535. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendPort")] + [JsonProperty(PropertyName = "properties.backendPort")] public int? BackendPort { get; set; } /// - /// Gets or sets the timeout for the TCP idle connection. The value - /// can be set between 4 and 30 minutes. The default value is 4 - /// minutes. This element is only used when the protocol is set to - /// TCP. + /// Gets or sets the timeout for the TCP idle connection. The value can + /// be set between 4 and 30 minutes. The default value is 4 minutes. + /// This element is only used when the protocol is set to TCP. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] + [JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] public int? IdleTimeoutInMinutes { get; set; } /// @@ -123,29 +128,30 @@ public InboundNatRule() { } /// AlwaysOn Availability Groups in SQL server. This setting can't be /// changed after you create the endpoint. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableFloatingIP")] + [JsonProperty(PropertyName = "properties.enableFloatingIP")] public bool? EnableFloatingIP { get; set; } /// /// Gets the provisioning state of the public IP resource. Possible /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets name of the resource that is unique within a resource group. /// This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IpAllocationMethod.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IpAllocationMethod.cs index 726112605c882..00fe60b7214ef 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IpAllocationMethod.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IpAllocationMethod.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for IPAllocationMethod. @@ -18,3 +21,4 @@ public static class IPAllocationMethod public const string Dynamic = "Dynamic"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancer.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancer.cs index 68d600d4c8540..55f054bb227f6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancer.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancer.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// LoadBalancer resource /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class LoadBalancer : Resource { /// @@ -33,8 +41,8 @@ public LoadBalancer() { } /// frontend IPs to be used for the load balancer /// Collection of backend address /// pools used by a load balancer - /// Object collection representing - /// the load balancing rules Gets the provisioning + /// Object collection representing the + /// load balancing rules Gets the provisioning /// Collection of probe objects used in the load /// balancer /// Collection of inbound NAT Rules used @@ -45,24 +53,24 @@ public LoadBalancer() { } /// reference an Inbound NAT pool. They have to reference individual /// inbound NAT rules. /// Defines an external port range for - /// inbound NAT to a single backend port on NICs associated with a - /// load balancer. Inbound NAT rules are created automatically for - /// each NIC associated with the Load Balancer using an external port - /// from this range. Defining an Inbound NAT pool on your Load - /// Balancer is mutually exclusive with defining inbound Nat rules. - /// Inbound NAT pools are referenced from virtual machine scale sets. - /// NICs that are associated with individual virtual machines cannot - /// reference an inbound NAT pool. They have to reference individual - /// inbound NAT rules. + /// inbound NAT to a single backend port on NICs associated with a load + /// balancer. Inbound NAT rules are created automatically for each NIC + /// associated with the Load Balancer using an external port from this + /// range. Defining an Inbound NAT pool on your Load Balancer is + /// mutually exclusive with defining inbound Nat rules. Inbound NAT + /// pools are referenced from virtual machine scale sets. NICs that are + /// associated with individual virtual machines cannot reference an + /// inbound NAT pool. They have to reference individual inbound NAT + /// rules. /// The outbound NAT rules. /// The resource GUID property of the load /// balancer resource. /// Gets the provisioning state of the - /// PublicIP resource. Possible values are: 'Updating', 'Deleting', - /// and 'Failed'. + /// PublicIP resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// A unique read-only string that changes whenever /// the resource is updated. - public LoadBalancer(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList frontendIPConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList backendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancingRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList probes = default(System.Collections.Generic.IList), System.Collections.Generic.IList inboundNatRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList inboundNatPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList outboundNatRules = default(System.Collections.Generic.IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + public LoadBalancer(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList frontendIPConfigurations = default(IList), IList backendAddressPools = default(IList), IList loadBalancingRules = default(IList), IList probes = default(IList), IList inboundNatRules = default(IList), IList inboundNatPools = default(IList), IList outboundNatRules = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { FrontendIPConfigurations = frontendIPConfigurations; @@ -81,82 +89,83 @@ public LoadBalancer() { } /// Gets or sets object representing the frontend IPs to be used for /// the load balancer /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfigurations")] - public System.Collections.Generic.IList FrontendIPConfigurations { get; set; } + [JsonProperty(PropertyName = "properties.frontendIPConfigurations")] + public IList FrontendIPConfigurations { get; set; } /// /// Gets or sets collection of backend address pools used by a load /// balancer /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPools")] - public System.Collections.Generic.IList BackendAddressPools { get; set; } + [JsonProperty(PropertyName = "properties.backendAddressPools")] + public IList BackendAddressPools { get; set; } /// /// Gets or sets object collection representing the load balancing /// rules Gets the provisioning /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancingRules")] - public System.Collections.Generic.IList LoadBalancingRules { get; set; } + [JsonProperty(PropertyName = "properties.loadBalancingRules")] + public IList LoadBalancingRules { get; set; } /// /// Gets or sets collection of probe objects used in the load balancer /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.probes")] - public System.Collections.Generic.IList Probes { get; set; } + [JsonProperty(PropertyName = "properties.probes")] + public IList Probes { get; set; } /// /// Gets or sets collection of inbound NAT Rules used by a load /// balancer. Defining inbound NAT rules on your load balancer is /// mutually exclusive with defining an inbound NAT pool. Inbound NAT - /// pools are referenced from virtual machine scale sets. NICs that - /// are associated with individual virtual machines cannot reference - /// an Inbound NAT pool. They have to reference individual inbound - /// NAT rules. + /// pools are referenced from virtual machine scale sets. NICs that are + /// associated with individual virtual machines cannot reference an + /// Inbound NAT pool. They have to reference individual inbound NAT + /// rules. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.inboundNatRules")] - public System.Collections.Generic.IList InboundNatRules { get; set; } + [JsonProperty(PropertyName = "properties.inboundNatRules")] + public IList InboundNatRules { get; set; } /// /// Gets or sets defines an external port range for inbound NAT to a /// single backend port on NICs associated with a load balancer. - /// Inbound NAT rules are created automatically for each NIC - /// associated with the Load Balancer using an external port from - /// this range. Defining an Inbound NAT pool on your Load Balancer is - /// mutually exclusive with defining inbound Nat rules. Inbound NAT - /// pools are referenced from virtual machine scale sets. NICs that - /// are associated with individual virtual machines cannot reference - /// an inbound NAT pool. They have to reference individual inbound - /// NAT rules. + /// Inbound NAT rules are created automatically for each NIC associated + /// with the Load Balancer using an external port from this range. + /// Defining an Inbound NAT pool on your Load Balancer is mutually + /// exclusive with defining inbound Nat rules. Inbound NAT pools are + /// referenced from virtual machine scale sets. NICs that are + /// associated with individual virtual machines cannot reference an + /// inbound NAT pool. They have to reference individual inbound NAT + /// rules. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.inboundNatPools")] - public System.Collections.Generic.IList InboundNatPools { get; set; } + [JsonProperty(PropertyName = "properties.inboundNatPools")] + public IList InboundNatPools { get; set; } /// /// Gets or sets the outbound NAT rules. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.outboundNatRules")] - public System.Collections.Generic.IList OutboundNatRules { get; set; } + [JsonProperty(PropertyName = "properties.outboundNatRules")] + public IList OutboundNatRules { get; set; } /// /// Gets or sets the resource GUID property of the load balancer /// resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// /// Gets the provisioning state of the PublicIP resource. Possible /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancingRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancingRule.cs index d2142963b455f..6839f761c1e6d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancingRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancingRule.cs @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// A loag balancing rule for a load balancer. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class LoadBalancingRule : SubResource { /// @@ -27,38 +33,37 @@ public LoadBalancingRule() { } /// The transport protocol for the external /// endpoint. Possible values are 'Udp' or 'Tcp'. Possible values /// include: 'Udp', 'Tcp' - /// The port for the external endpoint. - /// Port numbers for each Rule must be unique within the Load - /// Balancer. Acceptable values are between 1 and 65534. + /// The port for the external endpoint. Port + /// numbers for each Rule must be unique within the Load Balancer. + /// Acceptable values are between 1 and 65534. /// Resource ID. /// A reference to frontend IP /// addresses. /// A reference to a pool of DIPs. - /// Inbound traffic is randomly load balanced across IPs in the - /// backend IPs. + /// Inbound traffic is randomly load balanced across IPs in the backend + /// IPs. /// The reference of the load balancer probe used /// by the load balancing rule. /// The load distribution policy for /// this rule. Possible values are 'Default', 'SourceIP', and - /// 'SourceIPProtocol'. Possible values include: 'Default', - /// 'SourceIP', 'SourceIPProtocol' - /// The port used for internal connections - /// on the endpoint. Acceptable values are between 1 and 65535. - /// + /// 'SourceIPProtocol'. Possible values include: 'Default', 'SourceIP', + /// 'SourceIPProtocol' + /// The port used for internal connections on + /// the endpoint. Acceptable values are between 1 and 65535. /// The timeout for the TCP idle /// connection. The value can be set between 4 and 30 minutes. The /// default value is 4 minutes. This element is only used when the /// protocol is set to TCP. /// Configures a virtual machine's - /// endpoint for the floating IP capability required to configure a - /// SQL AlwaysOn Availability Group. This setting is required when - /// using the SQL AlwaysOn Availability Groups in SQL server. This - /// setting can't be changed after you create the endpoint. + /// endpoint for the floating IP capability required to configure a SQL + /// AlwaysOn Availability Group. This setting is required when using + /// the SQL AlwaysOn Availability Groups in SQL server. This setting + /// can't be changed after you create the endpoint. /// Gets the provisioning state of the - /// PublicIP resource. Possible values are: 'Updating', 'Deleting', - /// and 'Failed'. - /// The name of the resource that is unique within - /// a resource group. This name can be used to access the + /// PublicIP resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the /// resource. /// A unique read-only string that changes whenever /// the resource is updated. @@ -82,37 +87,37 @@ public LoadBalancingRule() { } /// /// Gets or sets a reference to frontend IP addresses. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfiguration")] + [JsonProperty(PropertyName = "properties.frontendIPConfiguration")] public SubResource FrontendIPConfiguration { get; set; } /// /// Gets or sets a reference to a pool of DIPs. Inbound traffic is /// randomly load balanced across IPs in the backend IPs. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPool")] + [JsonProperty(PropertyName = "properties.backendAddressPool")] public SubResource BackendAddressPool { get; set; } /// /// Gets or sets the reference of the load balancer probe used by the /// load balancing rule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.probe")] + [JsonProperty(PropertyName = "properties.probe")] public SubResource Probe { get; set; } /// /// Gets or sets the transport protocol for the external endpoint. - /// Possible values are 'Udp' or 'Tcp'. Possible values include: - /// 'Udp', 'Tcp' + /// Possible values are 'Udp' or 'Tcp'. Possible values include: 'Udp', + /// 'Tcp' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + [JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// /// Gets or sets the load distribution policy for this rule. Possible - /// values are 'Default', 'SourceIP', and 'SourceIPProtocol'. - /// Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' + /// values are 'Default', 'SourceIP', and 'SourceIPProtocol'. Possible + /// values include: 'Default', 'SourceIP', 'SourceIPProtocol' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadDistribution")] + [JsonProperty(PropertyName = "properties.loadDistribution")] public string LoadDistribution { get; set; } /// @@ -120,23 +125,22 @@ public LoadBalancingRule() { } /// each Rule must be unique within the Load Balancer. Acceptable /// values are between 1 and 65534. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendPort")] + [JsonProperty(PropertyName = "properties.frontendPort")] public int FrontendPort { get; set; } /// /// Gets or sets the port used for internal connections on the /// endpoint. Acceptable values are between 1 and 65535. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendPort")] + [JsonProperty(PropertyName = "properties.backendPort")] public int? BackendPort { get; set; } /// - /// Gets or sets the timeout for the TCP idle connection. The value - /// can be set between 4 and 30 minutes. The default value is 4 - /// minutes. This element is only used when the protocol is set to - /// TCP. + /// Gets or sets the timeout for the TCP idle connection. The value can + /// be set between 4 and 30 minutes. The default value is 4 minutes. + /// This element is only used when the protocol is set to TCP. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] + [JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] public int? IdleTimeoutInMinutes { get; set; } /// @@ -146,42 +150,43 @@ public LoadBalancingRule() { } /// AlwaysOn Availability Groups in SQL server. This setting can't be /// changed after you create the endpoint. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableFloatingIP")] + [JsonProperty(PropertyName = "properties.enableFloatingIP")] public bool? EnableFloatingIP { get; set; } /// /// Gets the provisioning state of the PublicIP resource. Possible /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets the name of the resource that is unique within a /// resource group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (Protocol == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Protocol"); + throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadDistribution.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadDistribution.cs index 625c462136ce2..80c2d72404e03 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadDistribution.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadDistribution.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for LoadDistribution. @@ -19,3 +22,4 @@ public static class LoadDistribution public const string SourceIPProtocol = "SourceIPProtocol"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LocalNetworkGateway.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LocalNetworkGateway.cs index 75432186c4cb8..e64b047c1e974 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LocalNetworkGateway.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LocalNetworkGateway.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// A common class for general resource information /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class LocalNetworkGateway : Resource { /// @@ -42,7 +50,7 @@ public LocalNetworkGateway() { } /// 'Deleting', and 'Failed'. /// A unique read-only string that changes whenever /// the resource is updated. - public LocalNetworkGateway(AddressSpace localNetworkAddressSpace, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string gatewayIpAddress = default(string), BgpSettings bgpSettings = default(BgpSettings), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + public LocalNetworkGateway(AddressSpace localNetworkAddressSpace, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string gatewayIpAddress = default(string), BgpSettings bgpSettings = default(BgpSettings), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { LocalNetworkAddressSpace = localNetworkAddressSpace; @@ -56,54 +64,55 @@ public LocalNetworkGateway() { } /// /// Gets or sets local network site address space. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.localNetworkAddressSpace")] + [JsonProperty(PropertyName = "properties.localNetworkAddressSpace")] public AddressSpace LocalNetworkAddressSpace { get; set; } /// /// Gets or sets IP address of local network gateway. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayIpAddress")] + [JsonProperty(PropertyName = "properties.gatewayIpAddress")] public string GatewayIpAddress { get; set; } /// /// Gets or sets local network gateway's BGP speaker settings. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bgpSettings")] + [JsonProperty(PropertyName = "properties.bgpSettings")] public BgpSettings BgpSettings { get; set; } /// /// Gets or sets the resource GUID property of the LocalNetworkGateway /// resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// /// Gets the provisioning state of the LocalNetworkGateway resource. /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; protected set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (LocalNetworkAddressSpace == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "LocalNetworkAddressSpace"); + throw new ValidationException(ValidationRules.CannotBeNull, "LocalNetworkAddressSpace"); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterface.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterface.cs index 9866fc272e10d..4ce1300cdac89 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterface.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterface.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// A network interface in a resource group. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class NetworkInterface : Resource { /// @@ -43,8 +51,8 @@ public NetworkInterface() { } /// interface on a virtual machine. /// If the network interface /// is accelerated networking enabled. - /// Indicates whether IP forwarding - /// is enabled on this network interface. + /// Indicates whether IP forwarding is + /// enabled on this network interface. /// The resource GUID property of the /// network interface resource. /// The provisioning state of the @@ -52,7 +60,7 @@ public NetworkInterface() { } /// and 'Failed'. /// A unique read-only string that changes whenever /// the resource is updated. - public NetworkInterface(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), SubResource virtualMachine = default(SubResource), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), NetworkInterfaceDnsSettings dnsSettings = default(NetworkInterfaceDnsSettings), string macAddress = default(string), bool? primary = default(bool?), bool? enableAcceleratedNetworking = default(bool?), bool? enableIPForwarding = default(bool?), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + public NetworkInterface(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SubResource virtualMachine = default(SubResource), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), IList ipConfigurations = default(IList), NetworkInterfaceDnsSettings dnsSettings = default(NetworkInterfaceDnsSettings), string macAddress = default(string), bool? primary = default(bool?), bool? enableAcceleratedNetworking = default(bool?), bool? enableIPForwarding = default(bool?), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { VirtualMachine = virtualMachine; @@ -71,74 +79,75 @@ public NetworkInterface() { } /// /// Gets or sets the reference of a virtual machine. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachine")] + [JsonProperty(PropertyName = "properties.virtualMachine")] public SubResource VirtualMachine { get; set; } /// /// Gets or sets the reference of the NetworkSecurityGroup resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkSecurityGroup")] + [JsonProperty(PropertyName = "properties.networkSecurityGroup")] public NetworkSecurityGroup NetworkSecurityGroup { get; set; } /// /// Gets or sets a list of IPConfigurations of the network interface. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] - public System.Collections.Generic.IList IpConfigurations { get; set; } + [JsonProperty(PropertyName = "properties.ipConfigurations")] + public IList IpConfigurations { get; set; } /// /// Gets or sets the DNS settings in network interface. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dnsSettings")] + [JsonProperty(PropertyName = "properties.dnsSettings")] public NetworkInterfaceDnsSettings DnsSettings { get; set; } /// /// Gets or sets the MAC address of the network interface. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.macAddress")] + [JsonProperty(PropertyName = "properties.macAddress")] public string MacAddress { get; set; } /// /// Gets whether this is a primary network interface on a virtual /// machine. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primary")] + [JsonProperty(PropertyName = "properties.primary")] public bool? Primary { get; set; } /// /// Gets or sets if the network interface is accelerated networking /// enabled. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableAcceleratedNetworking")] + [JsonProperty(PropertyName = "properties.enableAcceleratedNetworking")] public bool? EnableAcceleratedNetworking { get; set; } /// /// Gets or sets indicates whether IP forwarding is enabled on this /// network interface. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableIPForwarding")] + [JsonProperty(PropertyName = "properties.enableIPForwarding")] public bool? EnableIPForwarding { get; set; } /// /// Gets or sets the resource GUID property of the network interface /// resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// /// Gets or sets the provisioning state of the public IP resource. /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceDnsSettings.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceDnsSettings.cs index fa453f09e5e6d..92ca0e62c8da1 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceDnsSettings.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceDnsSettings.cs @@ -1,13 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -27,25 +33,24 @@ public NetworkInterfaceDnsSettings() { } /// /// List of DNS servers IP addresses. Use /// 'AzureProvidedDNS' to switch to azure provided DNS resolution. - /// 'AzureProvidedDNS' value cannot be combined with other IPs, it - /// must be the only value in dnsServers collection. + /// 'AzureProvidedDNS' value cannot be combined with other IPs, it must + /// be the only value in dnsServers collection. /// If the VM that uses this NIC is - /// part of an Availability Set, then this list will have the union - /// of all DNS servers from all NICs that are part of the - /// Availability Set. This property is what is configured on each of - /// those VMs. + /// part of an Availability Set, then this list will have the union of + /// all DNS servers from all NICs that are part of the Availability + /// Set. This property is what is configured on each of those + /// VMs. /// Relative DNS name for this NIC /// used for internal communications between VMs in the same virtual /// network. /// Fully qualified DNS name supporting /// internal communications between VMs in the same virtual /// network. - /// Even if - /// internalDnsNameLabel is not specified, a DNS entry is created for - /// the primary NIC of the VM. This DNS name can be constructed by - /// concatenating the VM name with the value of - /// internalDomainNameSuffix. - public NetworkInterfaceDnsSettings(System.Collections.Generic.IList dnsServers = default(System.Collections.Generic.IList), System.Collections.Generic.IList appliedDnsServers = default(System.Collections.Generic.IList), string internalDnsNameLabel = default(string), string internalFqdn = default(string), string internalDomainNameSuffix = default(string)) + /// Even if internalDnsNameLabel + /// is not specified, a DNS entry is created for the primary NIC of the + /// VM. This DNS name can be constructed by concatenating the VM name + /// with the value of internalDomainNameSuffix. + public NetworkInterfaceDnsSettings(IList dnsServers = default(IList), IList appliedDnsServers = default(IList), string internalDnsNameLabel = default(string), string internalFqdn = default(string), string internalDomainNameSuffix = default(string)) { DnsServers = dnsServers; AppliedDnsServers = appliedDnsServers; @@ -57,11 +62,11 @@ public NetworkInterfaceDnsSettings() { } /// /// Gets or sets list of DNS servers IP addresses. Use /// 'AzureProvidedDNS' to switch to azure provided DNS resolution. - /// 'AzureProvidedDNS' value cannot be combined with other IPs, it - /// must be the only value in dnsServers collection. + /// 'AzureProvidedDNS' value cannot be combined with other IPs, it must + /// be the only value in dnsServers collection. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "dnsServers")] - public System.Collections.Generic.IList DnsServers { get; set; } + [JsonProperty(PropertyName = "dnsServers")] + public IList DnsServers { get; set; } /// /// Gets or sets if the VM that uses this NIC is part of an @@ -69,21 +74,21 @@ public NetworkInterfaceDnsSettings() { } /// servers from all NICs that are part of the Availability Set. This /// property is what is configured on each of those VMs. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "appliedDnsServers")] - public System.Collections.Generic.IList AppliedDnsServers { get; set; } + [JsonProperty(PropertyName = "appliedDnsServers")] + public IList AppliedDnsServers { get; set; } /// /// Gets or sets relative DNS name for this NIC used for internal /// communications between VMs in the same virtual network. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "internalDnsNameLabel")] + [JsonProperty(PropertyName = "internalDnsNameLabel")] public string InternalDnsNameLabel { get; set; } /// /// Gets or sets fully qualified DNS name supporting internal /// communications between VMs in the same virtual network. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "internalFqdn")] + [JsonProperty(PropertyName = "internalFqdn")] public string InternalFqdn { get; set; } /// @@ -92,8 +97,9 @@ public NetworkInterfaceDnsSettings() { } /// be constructed by concatenating the VM name with the value of /// internalDomainNameSuffix. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "internalDomainNameSuffix")] + [JsonProperty(PropertyName = "internalDomainNameSuffix")] public string InternalDomainNameSuffix { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceIpConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceIpConfiguration.cs index f9b7b1fb590ab..1a340c0fc1665 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceIpConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceIpConfiguration.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// IPConfiguration in a network interface. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class NetworkInterfaceIPConfiguration : SubResource { /// @@ -43,12 +51,12 @@ public NetworkInterfaceIPConfiguration() { } /// 'IPv4', 'IPv6' /// Gets whether this is a primary customer /// address on the network interface. - /// The name of the resource that is unique within - /// a resource group. This name can be used to access the + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the /// resource. /// A unique read-only string that changes whenever /// the resource is updated. - public NetworkInterfaceIPConfiguration(string id = default(string), System.Collections.Generic.IList applicationGatewayBackendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancerBackendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancerInboundNatRules = default(System.Collections.Generic.IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), string privateIPAddressVersion = default(string), Subnet subnet = default(Subnet), bool? primary = default(bool?), PublicIPAddress publicIPAddress = default(PublicIPAddress), string provisioningState = default(string), string name = default(string), string etag = default(string)) + public NetworkInterfaceIPConfiguration(string id = default(string), IList applicationGatewayBackendAddressPools = default(IList), IList loadBalancerBackendAddressPools = default(IList), IList loadBalancerInboundNatRules = default(IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), string privateIPAddressVersion = default(string), Subnet subnet = default(Subnet), bool? primary = default(bool?), PublicIPAddress publicIPAddress = default(PublicIPAddress), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; @@ -69,79 +77,80 @@ public NetworkInterfaceIPConfiguration() { } /// Gets or sets the reference of ApplicationGatewayBackendAddressPool /// resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.applicationGatewayBackendAddressPools")] - public System.Collections.Generic.IList ApplicationGatewayBackendAddressPools { get; set; } + [JsonProperty(PropertyName = "properties.applicationGatewayBackendAddressPools")] + public IList ApplicationGatewayBackendAddressPools { get; set; } /// /// Gets or sets the reference of LoadBalancerBackendAddressPool /// resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancerBackendAddressPools")] - public System.Collections.Generic.IList LoadBalancerBackendAddressPools { get; set; } + [JsonProperty(PropertyName = "properties.loadBalancerBackendAddressPools")] + public IList LoadBalancerBackendAddressPools { get; set; } /// /// Gets or sets a list of references of LoadBalancerInboundNatRules. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancerInboundNatRules")] - public System.Collections.Generic.IList LoadBalancerInboundNatRules { get; set; } + [JsonProperty(PropertyName = "properties.loadBalancerInboundNatRules")] + public IList LoadBalancerInboundNatRules { get; set; } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddress")] + [JsonProperty(PropertyName = "properties.privateIPAddress")] public string PrivateIPAddress { get; set; } /// - /// Gets or sets defines how a private IP address is assigned. - /// Possible values are: 'Static' and 'Dynamic'. Possible values - /// include: 'Static', 'Dynamic' + /// Gets or sets defines how a private IP address is assigned. Possible + /// values are: 'Static' and 'Dynamic'. Possible values include: + /// 'Static', 'Dynamic' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] + [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] public string PrivateIPAllocationMethod { get; set; } /// /// Gets or sets available from Api-Version 2016-03-30 onwards, it /// represents whether the specific ipconfiguration is IPv4 or IPv6. - /// Default is taken as IPv4. Possible values are: 'IPv4' and - /// 'IPv6'. Possible values include: 'IPv4', 'IPv6' + /// Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + /// Possible values include: 'IPv4', 'IPv6' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddressVersion")] + [JsonProperty(PropertyName = "properties.privateIPAddressVersion")] public string PrivateIPAddressVersion { get; set; } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + [JsonProperty(PropertyName = "properties.subnet")] public Subnet Subnet { get; set; } /// /// Gets whether this is a primary customer address on the network /// interface. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primary")] + [JsonProperty(PropertyName = "properties.primary")] public bool? Primary { get; set; } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddress")] + [JsonProperty(PropertyName = "properties.publicIPAddress")] public PublicIPAddress PublicIPAddress { get; set; } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets the name of the resource that is unique within a /// resource group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkOperationStatus.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkOperationStatus.cs index a6db790ba9356..945fa6fe974c0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkOperationStatus.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkOperationStatus.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for NetworkOperationStatus. @@ -19,3 +22,4 @@ public static class NetworkOperationStatus public const string Failed = "Failed"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkSecurityGroup.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkSecurityGroup.cs index 0a1313f410b05..0b61b27e9f845 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkSecurityGroup.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkSecurityGroup.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// NetworkSecurityGroup resource. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class NetworkSecurityGroup : Resource { /// @@ -44,7 +52,7 @@ public NetworkSecurityGroup() { } /// and 'Failed'. /// A unique read-only string that changes whenever /// the resource is updated. - public NetworkSecurityGroup(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList securityRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList defaultSecurityRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList networkInterfaces = default(System.Collections.Generic.IList), System.Collections.Generic.IList subnets = default(System.Collections.Generic.IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + public NetworkSecurityGroup(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList securityRules = default(IList), IList defaultSecurityRules = default(IList), IList networkInterfaces = default(IList), IList subnets = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { SecurityRules = securityRules; @@ -57,50 +65,51 @@ public NetworkSecurityGroup() { } } /// - /// Gets or sets a collection of security rules of the network - /// security group. + /// Gets or sets a collection of security rules of the network security + /// group. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.securityRules")] - public System.Collections.Generic.IList SecurityRules { get; set; } + [JsonProperty(PropertyName = "properties.securityRules")] + public IList SecurityRules { get; set; } /// /// Gets or sets the default security rules of network security group. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultSecurityRules")] - public System.Collections.Generic.IList DefaultSecurityRules { get; set; } + [JsonProperty(PropertyName = "properties.defaultSecurityRules")] + public IList DefaultSecurityRules { get; set; } /// /// Gets a collection of references to network interfaces. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkInterfaces")] - public System.Collections.Generic.IList NetworkInterfaces { get; private set; } + [JsonProperty(PropertyName = "properties.networkInterfaces")] + public IList NetworkInterfaces { get; protected set; } /// /// Gets a collection of references to subnets. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnets")] - public System.Collections.Generic.IList Subnets { get; private set; } + [JsonProperty(PropertyName = "properties.subnets")] + public IList Subnets { get; protected set; } /// /// Gets or sets the resource GUID property of the network security /// group resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// /// Gets or sets the provisioning state of the public IP resource. /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/OutboundNatRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/OutboundNatRule.cs index 5cb7d9a341698..16bd512c248bd 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/OutboundNatRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/OutboundNatRule.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Outbound NAT pool of the load balancer. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class OutboundNatRule : SubResource { /// @@ -30,17 +38,17 @@ public OutboundNatRule() { } /// Resource ID. /// The number of outbound ports /// to be used for NAT. - /// The Frontend IP addresses - /// of the load balancer. + /// The Frontend IP addresses of + /// the load balancer. /// Gets the provisioning state of the - /// PublicIP resource. Possible values are: 'Updating', 'Deleting', - /// and 'Failed'. - /// The name of the resource that is unique within - /// a resource group. This name can be used to access the + /// PublicIP resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the /// resource. /// A unique read-only string that changes whenever /// the resource is updated. - public OutboundNatRule(SubResource backendAddressPool, string id = default(string), int? allocatedOutboundPorts = default(int?), System.Collections.Generic.IList frontendIPConfigurations = default(System.Collections.Generic.IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) + public OutboundNatRule(SubResource backendAddressPool, string id = default(string), int? allocatedOutboundPorts = default(int?), IList frontendIPConfigurations = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { AllocatedOutboundPorts = allocatedOutboundPorts; @@ -54,55 +62,56 @@ public OutboundNatRule() { } /// /// Gets or sets the number of outbound ports to be used for NAT. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allocatedOutboundPorts")] + [JsonProperty(PropertyName = "properties.allocatedOutboundPorts")] public int? AllocatedOutboundPorts { get; set; } /// /// Gets or sets the Frontend IP addresses of the load balancer. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.frontendIPConfigurations")] - public System.Collections.Generic.IList FrontendIPConfigurations { get; set; } + [JsonProperty(PropertyName = "properties.frontendIPConfigurations")] + public IList FrontendIPConfigurations { get; set; } /// /// Gets or sets a reference to a pool of DIPs. Outbound traffic is /// randomly load balanced across IPs in the backend IPs. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backendAddressPool")] + [JsonProperty(PropertyName = "properties.backendAddressPool")] public SubResource BackendAddressPool { get; set; } /// /// Gets the provisioning state of the PublicIP resource. Possible /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets the name of the resource that is unique within a /// resource group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (BackendAddressPool == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "BackendAddressPool"); + throw new ValidationException(ValidationRules.CannotBeNull, "BackendAddressPool"); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Page.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Page.cs index 6894e76ad10b5..f5a47fff73b27 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Page.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Page.cs @@ -1,46 +1,55 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [Newtonsoft.Json.JsonObject] - public class Page : Microsoft.Rest.Azure.IPage + [JsonObject] + public class Page : IPage { /// /// Gets the link to the next page. /// - [Newtonsoft.Json.JsonProperty("nextLink")] - public System.String NextPageLink { get; private set; } + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } - [Newtonsoft.Json.JsonProperty("value")] - private System.Collections.Generic.IList Items{ get; set; } + [JsonProperty("value")] + private IList Items{ get; set; } /// /// Returns an enumerator that iterates through the collection. /// /// A an enumerator that can be used to iterate through the collection. - public System.Collections.Generic.IEnumerator GetEnumerator() + public IEnumerator GetEnumerator() { - return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); } /// /// Returns an enumerator that iterates through the collection. /// /// A an enumerator that can be used to iterate through the collection. - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Probe.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Probe.cs index 08bfca1ef8580..d39aaca80d44b 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Probe.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Probe.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// A load balancer probe. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class Probe : SubResource { /// @@ -25,31 +33,29 @@ public Probe() { } /// Initializes a new instance of the Probe class. /// /// The protocol of the end point. Possible - /// values are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received - /// ACK is required for the probe to be successful. If 'Http' is - /// specified, a 200 OK response from the specifies URI is required - /// for the probe to be successful. Possible values include: 'Http', - /// 'Tcp' + /// values are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK + /// is required for the probe to be successful. If 'Http' is specified, + /// a 200 OK response from the specifies URI is required for the probe + /// to be successful. Possible values include: 'Http', 'Tcp' /// The port for communicating the probe. Possible /// values range from 1 to 65535, inclusive. /// Resource ID. /// The load balancer rules that use /// this probe. /// The interval, in seconds, for how - /// frequently to probe the endpoint for health status. Typically, - /// the interval is slightly less than half the allocated timeout - /// period (in seconds) which allows two full probes before taking - /// the instance out of rotation. The default value is 15, the - /// minimum value is 5. + /// frequently to probe the endpoint for health status. Typically, the + /// interval is slightly less than half the allocated timeout period + /// (in seconds) which allows two full probes before taking the + /// instance out of rotation. The default value is 15, the minimum + /// value is 5. /// The number of probes where if no /// response, will result in stopping further traffic from being - /// delivered to the endpoint. This values allows endpoints to be - /// taken out of rotation faster or slower than the typical times - /// used in Azure. - /// The URI used for requesting health - /// status from the VM. Path is required if a protocol is set to - /// http. Otherwise, it is not allowed. There is no default - /// value. + /// delivered to the endpoint. This values allows endpoints to be taken + /// out of rotation faster or slower than the typical times used in + /// Azure. + /// The URI used for requesting health status + /// from the VM. Path is required if a protocol is set to http. + /// Otherwise, it is not allowed. There is no default value. /// Gets the provisioning state of the /// public IP resource. Possible values are: 'Updating', 'Deleting', /// and 'Failed'. @@ -58,7 +64,7 @@ public Probe() { } /// resource. /// A unique read-only string that changes whenever /// the resource is updated. - public Probe(string protocol, int port, string id = default(string), System.Collections.Generic.IList loadBalancingRules = default(System.Collections.Generic.IList), int? intervalInSeconds = default(int?), int? numberOfProbes = default(int?), string requestPath = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) + public Probe(string protocol, int port, string id = default(string), IList loadBalancingRules = default(IList), int? intervalInSeconds = default(int?), int? numberOfProbes = default(int?), string requestPath = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { LoadBalancingRules = loadBalancingRules; @@ -75,86 +81,87 @@ public Probe() { } /// /// Gets the load balancer rules that use this probe. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancingRules")] - public System.Collections.Generic.IList LoadBalancingRules { get; private set; } + [JsonProperty(PropertyName = "properties.loadBalancingRules")] + public IList LoadBalancingRules { get; protected set; } /// /// Gets or sets the protocol of the end point. Possible values are: - /// 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is - /// required for the probe to be successful. If 'Http' is specified, - /// a 200 OK response from the specifies URI is required for the - /// probe to be successful. Possible values include: 'Http', 'Tcp' + /// 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + /// for the probe to be successful. If 'Http' is specified, a 200 OK + /// response from the specifies URI is required for the probe to be + /// successful. Possible values include: 'Http', 'Tcp' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + [JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// /// Gets or sets the port for communicating the probe. Possible values /// range from 1 to 65535, inclusive. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.port")] + [JsonProperty(PropertyName = "properties.port")] public int Port { get; set; } /// /// Gets or sets the interval, in seconds, for how frequently to probe - /// the endpoint for health status. Typically, the interval is - /// slightly less than half the allocated timeout period (in seconds) - /// which allows two full probes before taking the instance out of - /// rotation. The default value is 15, the minimum value is 5. + /// the endpoint for health status. Typically, the interval is slightly + /// less than half the allocated timeout period (in seconds) which + /// allows two full probes before taking the instance out of rotation. + /// The default value is 15, the minimum value is 5. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.intervalInSeconds")] + [JsonProperty(PropertyName = "properties.intervalInSeconds")] public int? IntervalInSeconds { get; set; } /// - /// Gets or sets the number of probes where if no response, will - /// result in stopping further traffic from being delivered to the - /// endpoint. This values allows endpoints to be taken out of - /// rotation faster or slower than the typical times used in Azure. + /// Gets or sets the number of probes where if no response, will result + /// in stopping further traffic from being delivered to the endpoint. + /// This values allows endpoints to be taken out of rotation faster or + /// slower than the typical times used in Azure. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.numberOfProbes")] + [JsonProperty(PropertyName = "properties.numberOfProbes")] public int? NumberOfProbes { get; set; } /// - /// Gets or sets the URI used for requesting health status from the - /// VM. Path is required if a protocol is set to http. Otherwise, it - /// is not allowed. There is no default value. + /// Gets or sets the URI used for requesting health status from the VM. + /// Path is required if a protocol is set to http. Otherwise, it is not + /// allowed. There is no default value. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.requestPath")] + [JsonProperty(PropertyName = "properties.requestPath")] public string RequestPath { get; set; } /// /// Gets the provisioning state of the public IP resource. Possible /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets name of the resource that is unique within a resource group. /// This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (Protocol == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Protocol"); + throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProbeProtocol.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProbeProtocol.cs index d378cd1c571d6..43bac48b01273 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProbeProtocol.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProbeProtocol.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for ProbeProtocol. @@ -18,3 +21,4 @@ public static class ProbeProtocol public const string Tcp = "Tcp"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProcessorArchitecture.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProcessorArchitecture.cs index b22d75977dfd5..891cac826ab0c 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProcessorArchitecture.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProcessorArchitecture.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for ProcessorArchitecture. @@ -18,3 +21,4 @@ public static class ProcessorArchitecture public const string X86 = "X86"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddress.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddress.cs index bc714abca3697..a170c074263a6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddress.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddress.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Public IP address resource. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class PublicIPAddress : Resource { /// @@ -32,21 +40,21 @@ public PublicIPAddress() { } /// The public IP allocation /// method. Possible values are: 'Static' and 'Dynamic'. Possible /// values include: 'Static', 'Dynamic' - /// The public IP address - /// version. Possible values are: 'IPv4' and 'IPv6'. Possible values - /// include: 'IPv4', 'IPv6' + /// The public IP address version. + /// Possible values are: 'IPv4' and 'IPv6'. Possible values include: + /// 'IPv4', 'IPv6' /// The FQDN of the DNS record associated /// with the public IP address. /// The idle timeout of the public /// IP address. - /// The resource GUID property of the - /// public IP resource. + /// The resource GUID property of the public + /// IP resource. /// The provisioning state of the - /// PublicIP resource. Possible values are: 'Updating', 'Deleting', - /// and 'Failed'. + /// PublicIP resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// A unique read-only string that changes whenever /// the resource is updated. - public PublicIPAddress(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string publicIPAllocationMethod = default(string), string publicIPAddressVersion = default(string), IPConfiguration ipConfiguration = default(IPConfiguration), PublicIPAddressDnsSettings dnsSettings = default(PublicIPAddressDnsSettings), string ipAddress = default(string), int? idleTimeoutInMinutes = default(int?), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + public PublicIPAddress(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string publicIPAllocationMethod = default(string), string publicIPAddressVersion = default(string), IPConfiguration ipConfiguration = default(IPConfiguration), PublicIPAddressDnsSettings dnsSettings = default(PublicIPAddressDnsSettings), string ipAddress = default(string), int? idleTimeoutInMinutes = default(int?), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { PublicIPAllocationMethod = publicIPAllocationMethod; @@ -65,58 +73,59 @@ public PublicIPAddress() { } /// 'Static' and 'Dynamic'. Possible values include: 'Static', /// 'Dynamic' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAllocationMethod")] + [JsonProperty(PropertyName = "properties.publicIPAllocationMethod")] public string PublicIPAllocationMethod { get; set; } /// /// Gets or sets the public IP address version. Possible values are: /// 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddressVersion")] + [JsonProperty(PropertyName = "properties.publicIPAddressVersion")] public string PublicIPAddressVersion { get; set; } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfiguration")] - public IPConfiguration IpConfiguration { get; private set; } + [JsonProperty(PropertyName = "properties.ipConfiguration")] + public IPConfiguration IpConfiguration { get; protected set; } /// /// Gets or sets the FQDN of the DNS record associated with the public /// IP address. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dnsSettings")] + [JsonProperty(PropertyName = "properties.dnsSettings")] public PublicIPAddressDnsSettings DnsSettings { get; set; } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipAddress")] + [JsonProperty(PropertyName = "properties.ipAddress")] public string IpAddress { get; set; } /// /// Gets or sets the idle timeout of the public IP address. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] + [JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] public int? IdleTimeoutInMinutes { get; set; } /// /// Gets or sets the resource GUID property of the public IP resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// /// Gets or sets the provisioning state of the PublicIP resource. /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddressDnsSettings.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddressDnsSettings.cs index 3298d22a9e069..70ae86bb7acb9 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddressDnsSettings.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddressDnsSettings.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; using System.Linq; /// @@ -31,9 +35,8 @@ public PublicIPAddressDnsSettings() { } /// record is created for the public IP in the Microsoft Azure DNS /// system. /// The FQDN (fully qualified domain name) of the A - /// DNS record associated with the public IP. This is the - /// concatenation of the domainNameLabel and the regionalized DNS - /// zone. + /// DNS record associated with the public IP. This is the concatenation + /// of the domainNameLabel and the regionalized DNS zone. /// The reverse FQDN. A user-visible, fully /// qualified domain name that resolves to this public IP address. If /// the reverseFqdn is specified, then a PTR DNS record is created @@ -47,32 +50,32 @@ public PublicIPAddressDnsSettings() { } } /// - /// Gets or sets the domain name label. The concatenation of the - /// domain name label and the regionalized DNS zone make up the fully + /// Gets or sets the domain name label. The concatenation of the domain + /// name label and the regionalized DNS zone make up the fully /// qualified domain name associated with the public IP address. If a - /// domain name label is specified, an A DNS record is created for - /// the public IP in the Microsoft Azure DNS system. + /// domain name label is specified, an A DNS record is created for the + /// public IP in the Microsoft Azure DNS system. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "domainNameLabel")] + [JsonProperty(PropertyName = "domainNameLabel")] public string DomainNameLabel { get; set; } /// /// Gets or sets the FQDN (fully qualified domain name) of the A DNS - /// record associated with the public IP. This is the concatenation - /// of the domainNameLabel and the regionalized DNS zone. + /// record associated with the public IP. This is the concatenation of + /// the domainNameLabel and the regionalized DNS zone. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "fqdn")] + [JsonProperty(PropertyName = "fqdn")] public string Fqdn { get; set; } /// /// Gets or sets the reverse FQDN. A user-visible, fully qualified /// domain name that resolves to this public IP address. If the - /// reverseFqdn is specified, then a PTR DNS record is created - /// pointing from the IP address in the in-addr.arpa domain to the - /// reverse FQDN. + /// reverseFqdn is specified, then a PTR DNS record is created pointing + /// from the IP address in the in-addr.arpa domain to the reverse FQDN. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "reverseFqdn")] + [JsonProperty(PropertyName = "reverseFqdn")] public string ReverseFqdn { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Resource.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Resource.cs index 55e88c3769d20..ee22be48703db 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Resource.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Resource.cs @@ -1,16 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; - public partial class Resource : Microsoft.Rest.Azure.IResource + public partial class Resource : IResource { /// /// Initializes a new instance of the Resource class. @@ -25,7 +33,7 @@ public Resource() { } /// Resource type. /// Resource location. /// Resource tags. - public Resource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + public Resource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary)) { Id = id; Name = name; @@ -37,32 +45,33 @@ public Resource() { } /// /// Gets or sets resource ID. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// /// Gets resource name. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [JsonProperty(PropertyName = "name")] + public string Name { get; protected set; } /// /// Gets resource type. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [JsonProperty(PropertyName = "type")] + public string Type { get; protected set; } /// /// Gets or sets resource location. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [JsonProperty(PropertyName = "location")] public string Location { get; set; } /// /// Gets or sets resource tags. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] - public System.Collections.Generic.IDictionary Tags { get; set; } + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ResourceNavigationLink.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ResourceNavigationLink.cs index bf119472dcc20..03420b4b17b44 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ResourceNavigationLink.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ResourceNavigationLink.cs @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// ResourceNavigationLink resource. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class ResourceNavigationLink : SubResource { /// @@ -48,34 +54,35 @@ public ResourceNavigationLink() { } /// /// Gets or sets resource type of the linked resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.linkedResourceType")] + [JsonProperty(PropertyName = "properties.linkedResourceType")] public string LinkedResourceType { get; set; } /// /// Gets or sets link to the external resource /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.link")] + [JsonProperty(PropertyName = "properties.link")] public string Link { get; set; } /// /// Gets provisioning state of the ResourceNavigationLink resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; protected set; } /// /// Gets or sets name of the resource that is unique within a resource /// group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets a unique read-only string that changes whenever the resource /// is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [JsonProperty(PropertyName = "etag")] + public string Etag { get; protected set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Route.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Route.cs index 7d74d21fa0d81..163ddade41faf 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Route.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Route.cs @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// Route resource /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class Route : SubResource { /// @@ -30,16 +36,16 @@ public Route() { } /// values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', /// 'VirtualAppliance', 'None' /// Resource ID. - /// The destination CIDR to which the - /// route applies. + /// The destination CIDR to which the route + /// applies. /// The IP address packets should be - /// forwarded to. Next hop values are only allowed in routes where - /// the next hop type is VirtualAppliance. + /// forwarded to. Next hop values are only allowed in routes where the + /// next hop type is VirtualAppliance. /// The provisioning state of the /// resource. Possible values are: 'Updating', 'Deleting', and /// 'Failed'. - /// The name of the resource that is unique within - /// a resource group. This name can be used to access the + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the /// resource. /// A unique read-only string that changes whenever /// the resource is updated. @@ -57,7 +63,7 @@ public Route() { } /// /// Gets or sets the destination CIDR to which the route applies. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.addressPrefix")] + [JsonProperty(PropertyName = "properties.addressPrefix")] public string AddressPrefix { get; set; } /// @@ -67,7 +73,7 @@ public Route() { } /// include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', /// 'VirtualAppliance', 'None' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.nextHopType")] + [JsonProperty(PropertyName = "properties.nextHopType")] public string NextHopType { get; set; } /// @@ -75,42 +81,43 @@ public Route() { } /// hop values are only allowed in routes where the next hop type is /// VirtualAppliance. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.nextHopIpAddress")] + [JsonProperty(PropertyName = "properties.nextHopIpAddress")] public string NextHopIpAddress { get; set; } /// /// Gets or sets the provisioning state of the resource. Possible /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets the name of the resource that is unique within a /// resource group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (NextHopType == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "NextHopType"); + throw new ValidationException(ValidationRules.CannotBeNull, "NextHopType"); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteNextHopType.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteNextHopType.cs index 3d782fcd78c45..28fed7dbe569e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteNextHopType.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteNextHopType.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for RouteNextHopType. @@ -21,3 +24,4 @@ public static class RouteNextHopType public const string None = "None"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteTable.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteTable.cs index cfb221662409e..9a2241c0fda66 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteTable.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteTable.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Route table resource. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class RouteTable : Resource { /// @@ -38,7 +46,7 @@ public RouteTable() { } /// 'Failed'. /// Gets a unique read-only string that changes /// whenever the resource is updated. - public RouteTable(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList routes = default(System.Collections.Generic.IList), System.Collections.Generic.IList subnets = default(System.Collections.Generic.IList), string provisioningState = default(string), string etag = default(string)) + public RouteTable(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList routes = default(IList), IList subnets = default(IList), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { Routes = routes; @@ -50,28 +58,29 @@ public RouteTable() { } /// /// Gets or sets collection of routes contained within a route table. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routes")] - public System.Collections.Generic.IList Routes { get; set; } + [JsonProperty(PropertyName = "properties.routes")] + public IList Routes { get; set; } /// /// Gets a collection of references to subnets. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnets")] - public System.Collections.Generic.IList Subnets { get; private set; } + [JsonProperty(PropertyName = "properties.subnets")] + public IList Subnets { get; protected set; } /// /// Gets or sets the provisioning state of the resource. Possible /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets a unique read-only string that changes whenever the resource /// is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRule.cs index 8e8a7fe00fb29..ccdbc104c7265 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRule.cs @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// Network security rule. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class SecurityRule : SubResource { /// @@ -25,13 +31,13 @@ public SecurityRule() { } /// Initializes a new instance of the SecurityRule class. /// /// Network protocol this rule applies to. - /// Possible values are 'Tcp', 'Udp', and '*'. Possible values - /// include: 'Tcp', 'Udp', '*' + /// Possible values are 'Tcp', 'Udp', and '*'. Possible values include: + /// 'Tcp', 'Udp', '*' /// The CIDR or source IP range. - /// Asterix '*' can also be used to match all source IPs. Default - /// tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - /// can also be used. If this is an ingress rule, specifies where - /// network traffic originates from. + /// Asterix '*' can also be used to match all source IPs. Default tags + /// such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can + /// also be used. If this is an ingress rule, specifies where network + /// traffic originates from. /// The destination address /// prefix. CIDR or source IP range. Asterix '*' can also be used to /// match all source IPs. Default tags such as 'VirtualNetwork', @@ -50,8 +56,8 @@ public SecurityRule() { } /// range between 0 and 65535. Asterix '*' can also be used to match /// all ports. /// The destination port or range. - /// Integer or range between 0 and 65535. Asterix '*' can also be - /// used to match all ports. + /// Integer or range between 0 and 65535. Asterix '*' can also be used + /// to match all ports. /// The priority of the rule. The value can be /// between 100 and 4096. The priority number must be unique for each /// rule in the collection. The lower the priority number, the higher @@ -59,8 +65,8 @@ public SecurityRule() { } /// The provisioning state of the /// public IP resource. Possible values are: 'Updating', 'Deleting', /// and 'Failed'. - /// The name of the resource that is unique within - /// a resource group. This name can be used to access the + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the /// resource. /// A unique read-only string that changes whenever /// the resource is updated. @@ -84,22 +90,22 @@ public SecurityRule() { } /// /// Gets or sets a description for this rule. Restricted to 140 chars. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + [JsonProperty(PropertyName = "properties.description")] public string Description { get; set; } /// - /// Gets or sets network protocol this rule applies to. Possible - /// values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', - /// 'Udp', '*' + /// Gets or sets network protocol this rule applies to. Possible values + /// are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + /// '*' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocol")] + [JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// /// Gets or sets the source port or range. Integer or range between 0 /// and 65535. Asterix '*' can also be used to match all ports. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourcePortRange")] + [JsonProperty(PropertyName = "properties.sourcePortRange")] public string SourcePortRange { get; set; } /// @@ -107,7 +113,7 @@ public SecurityRule() { } /// between 0 and 65535. Asterix '*' can also be used to match all /// ports. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinationPortRange")] + [JsonProperty(PropertyName = "properties.destinationPortRange")] public string DestinationPortRange { get; set; } /// @@ -117,7 +123,7 @@ public SecurityRule() { } /// used. If this is an ingress rule, specifies where network traffic /// originates from. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourceAddressPrefix")] + [JsonProperty(PropertyName = "properties.sourceAddressPrefix")] public string SourceAddressPrefix { get; set; } /// @@ -126,7 +132,7 @@ public SecurityRule() { } /// Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and /// 'Internet' can also be used. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destinationAddressPrefix")] + [JsonProperty(PropertyName = "properties.destinationAddressPrefix")] public string DestinationAddressPrefix { get; set; } /// @@ -134,16 +140,16 @@ public SecurityRule() { } /// values are: 'Allow' and 'Deny'. Possible values include: 'Allow', /// 'Deny' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.access")] + [JsonProperty(PropertyName = "properties.access")] public string Access { get; set; } /// - /// Gets or sets the priority of the rule. The value can be between - /// 100 and 4096. The priority number must be unique for each rule in - /// the collection. The lower the priority number, the higher the - /// priority of the rule. + /// Gets or sets the priority of the rule. The value can be between 100 + /// and 4096. The priority number must be unique for each rule in the + /// collection. The lower the priority number, the higher the priority + /// of the rule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priority")] + [JsonProperty(PropertyName = "properties.priority")] public int? Priority { get; set; } /// @@ -152,58 +158,59 @@ public SecurityRule() { } /// values are: 'Inbound' and 'Outbound'. Possible values include: /// 'Inbound', 'Outbound' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.direction")] + [JsonProperty(PropertyName = "properties.direction")] public string Direction { get; set; } /// /// Gets or sets the provisioning state of the public IP resource. /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets the name of the resource that is unique within a /// resource group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (Protocol == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Protocol"); + throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); } if (SourceAddressPrefix == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "SourceAddressPrefix"); + throw new ValidationException(ValidationRules.CannotBeNull, "SourceAddressPrefix"); } if (DestinationAddressPrefix == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DestinationAddressPrefix"); + throw new ValidationException(ValidationRules.CannotBeNull, "DestinationAddressPrefix"); } if (Access == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Access"); + throw new ValidationException(ValidationRules.CannotBeNull, "Access"); } if (Direction == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Direction"); + throw new ValidationException(ValidationRules.CannotBeNull, "Direction"); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleAccess.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleAccess.cs index 78db23993f926..7cd9ce222f29f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleAccess.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleAccess.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for SecurityRuleAccess. @@ -18,3 +21,4 @@ public static class SecurityRuleAccess public const string Deny = "Deny"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleDirection.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleDirection.cs index 3af4f1915d01a..2ea2c10c51882 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleDirection.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleDirection.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for SecurityRuleDirection. @@ -18,3 +21,4 @@ public static class SecurityRuleDirection public const string Outbound = "Outbound"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleProtocol.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleProtocol.cs index 3ad57550e2682..a9c32920efae0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleProtocol.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleProtocol.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for SecurityRuleProtocol. @@ -19,3 +22,4 @@ public static class SecurityRuleProtocol public const string Asterisk = "*"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ServiceProviderProvisioningState.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ServiceProviderProvisioningState.cs index 9bd50cd1fe5d6..e371f76d320e6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ServiceProviderProvisioningState.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ServiceProviderProvisioningState.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for ServiceProviderProvisioningState. @@ -20,3 +23,4 @@ public static class ServiceProviderProvisioningState public const string Deprovisioning = "Deprovisioning"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SubResource.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SubResource.cs index 918737cb97f2b..6ee08a2a74609 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SubResource.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SubResource.cs @@ -1,16 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Azure; + using Newtonsoft.Json; using System.Linq; - public partial class SubResource : Microsoft.Rest.Azure.IResource + public partial class SubResource : IResource { /// /// Initializes a new instance of the SubResource class. @@ -29,8 +35,9 @@ public SubResource() { } /// /// Gets or sets resource ID. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Subnet.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Subnet.cs index 061930fbf5023..144b12acd9866 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Subnet.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Subnet.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Subnet in a virtual network resource. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class Subnet : SubResource { /// @@ -37,12 +45,12 @@ public Subnet() { } /// to the external resources using subnet. /// The provisioning state of the /// resource. - /// The name of the resource that is unique within - /// a resource group. This name can be used to access the + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the /// resource. /// A unique read-only string that changes whenever /// the resource is updated. - public Subnet(string id = default(string), string addressPrefix = default(string), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), RouteTable routeTable = default(RouteTable), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), System.Collections.Generic.IList resourceNavigationLinks = default(System.Collections.Generic.IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) + public Subnet(string id = default(string), string addressPrefix = default(string), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), RouteTable routeTable = default(RouteTable), IList ipConfigurations = default(IList), IList resourceNavigationLinks = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { AddressPrefix = addressPrefix; @@ -58,53 +66,54 @@ public Subnet() { } /// /// Gets or sets the address prefix for the subnet. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.addressPrefix")] + [JsonProperty(PropertyName = "properties.addressPrefix")] public string AddressPrefix { get; set; } /// /// Gets or sets the reference of the NetworkSecurityGroup resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkSecurityGroup")] + [JsonProperty(PropertyName = "properties.networkSecurityGroup")] public NetworkSecurityGroup NetworkSecurityGroup { get; set; } /// /// Gets or sets the reference of the RouteTable resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routeTable")] + [JsonProperty(PropertyName = "properties.routeTable")] public RouteTable RouteTable { get; set; } /// /// Gets an array of references to the network interface IP /// configurations using subnet. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] - public System.Collections.Generic.IList IpConfigurations { get; private set; } + [JsonProperty(PropertyName = "properties.ipConfigurations")] + public IList IpConfigurations { get; protected set; } /// /// Gets an array of references to the external resources using subnet. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceNavigationLinks")] - public System.Collections.Generic.IList ResourceNavigationLinks { get; set; } + [JsonProperty(PropertyName = "properties.resourceNavigationLinks")] + public IList ResourceNavigationLinks { get; set; } /// /// Gets or sets the provisioning state of the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets the name of the resource that is unique within a /// resource group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TransportProtocol.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TransportProtocol.cs index aedeefd1af1cc..8635ba7c89f88 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TransportProtocol.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TransportProtocol.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for TransportProtocol. @@ -18,3 +21,4 @@ public static class TransportProtocol public const string Tcp = "Tcp"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TunnelConnectionHealth.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TunnelConnectionHealth.cs index fddfc7f52bd9f..b5f12b12006ac 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TunnelConnectionHealth.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TunnelConnectionHealth.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; using System.Linq; /// @@ -27,8 +31,8 @@ public TunnelConnectionHealth() { } /// Virtual network Gateway connection /// status. Possible values include: 'Unknown', 'Connecting', /// 'Connected', 'NotConnected' - /// The Ingress Bytes - /// Transferred in this connection + /// The Ingress Bytes Transferred + /// in this connection /// The Egress Bytes Transferred /// in this connection /// The time at which @@ -45,33 +49,34 @@ public TunnelConnectionHealth() { } /// /// Gets tunnel name. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "tunnel")] - public string Tunnel { get; private set; } + [JsonProperty(PropertyName = "tunnel")] + public string Tunnel { get; protected set; } /// /// Gets virtual network Gateway connection status. Possible values /// include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "connectionStatus")] - public string ConnectionStatus { get; private set; } + [JsonProperty(PropertyName = "connectionStatus")] + public string ConnectionStatus { get; protected set; } /// /// Gets the Ingress Bytes Transferred in this connection /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ingressBytesTransferred")] - public long? IngressBytesTransferred { get; private set; } + [JsonProperty(PropertyName = "ingressBytesTransferred")] + public long? IngressBytesTransferred { get; protected set; } /// /// Gets the Egress Bytes Transferred in this connection /// - [Newtonsoft.Json.JsonProperty(PropertyName = "egressBytesTransferred")] - public long? EgressBytesTransferred { get; private set; } + [JsonProperty(PropertyName = "egressBytesTransferred")] + public long? EgressBytesTransferred { get; protected set; } /// /// Gets the time at which connection was established in Utc format. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lastConnectionEstablishedUtcTime")] - public string LastConnectionEstablishedUtcTime { get; private set; } + [JsonProperty(PropertyName = "lastConnectionEstablishedUtcTime")] + public string LastConnectionEstablishedUtcTime { get; protected set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Usage.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Usage.cs index b866af41e71e3..53195b718c2b0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Usage.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Usage.cs @@ -1,13 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -43,39 +48,40 @@ static Usage() /// /// Gets or sets the current value of the usage. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "currentValue")] + [JsonProperty(PropertyName = "currentValue")] public long CurrentValue { get; set; } /// /// Gets or sets the limit of usage. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "limit")] + [JsonProperty(PropertyName = "limit")] public long Limit { get; set; } /// /// Gets or sets the name of the type of usage. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public UsageName Name { get; set; } /// /// An enum describing the unit of measurement. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "unit")] + [JsonProperty(PropertyName = "unit")] public static string Unit { get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (Name == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/UsageName.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/UsageName.cs index 0960abdb46b05..f5d33240e0ff7 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/UsageName.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/UsageName.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; using System.Linq; /// @@ -35,14 +39,15 @@ public UsageName() { } /// /// Gets or sets a string describing the resource name. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + [JsonProperty(PropertyName = "value")] public string Value { get; set; } /// /// Gets or sets a localized string describing the resource name. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "localizedValue")] + [JsonProperty(PropertyName = "localizedValue")] public string LocalizedValue { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetwork.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetwork.cs index 5c668135285c7..ee350e126ab52 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetwork.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetwork.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Virtual Network resource. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class VirtualNetwork : Resource { /// @@ -31,21 +39,21 @@ public VirtualNetwork() { } /// Resource tags. /// The AddressSpace that contains an array /// of IP address ranges that can be used by subnets. - /// The dhcpOptions that contains an array - /// of DNS servers available to VMs deployed in the virtual + /// The dhcpOptions that contains an array of + /// DNS servers available to VMs deployed in the virtual /// network. /// A list of subnets in a Virtual /// Network. /// A list of peerings in a /// Virtual Network. - /// The resourceGuid property of the - /// Virtual Network resource. + /// The resourceGuid property of the Virtual + /// Network resource. /// The provisioning state of the - /// PublicIP resource. Possible values are: 'Updating', 'Deleting', - /// and 'Failed'. + /// PublicIP resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// Gets a unique read-only string that changes /// whenever the resource is updated. - public VirtualNetwork(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), AddressSpace addressSpace = default(AddressSpace), DhcpOptions dhcpOptions = default(DhcpOptions), System.Collections.Generic.IList subnets = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualNetworkPeerings = default(System.Collections.Generic.IList), string resourceGuid = default(string), string provisioningState = default(string), 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), string etag = default(string)) : base(id, name, type, location, tags) { AddressSpace = addressSpace; @@ -61,48 +69,49 @@ public VirtualNetwork() { } /// Gets or sets the AddressSpace that contains an array of IP address /// ranges that can be used by subnets. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.addressSpace")] + [JsonProperty(PropertyName = "properties.addressSpace")] public AddressSpace AddressSpace { get; set; } /// /// Gets or sets the dhcpOptions that contains an array of DNS servers /// available to VMs deployed in the virtual network. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dhcpOptions")] + [JsonProperty(PropertyName = "properties.dhcpOptions")] public DhcpOptions DhcpOptions { get; set; } /// /// Gets or sets a list of subnets in a Virtual Network. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnets")] - public System.Collections.Generic.IList Subnets { get; set; } + [JsonProperty(PropertyName = "properties.subnets")] + public IList Subnets { get; set; } /// /// Gets or sets a list of peerings in a Virtual Network. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualNetworkPeerings")] - public System.Collections.Generic.IList VirtualNetworkPeerings { get; set; } + [JsonProperty(PropertyName = "properties.virtualNetworkPeerings")] + public IList VirtualNetworkPeerings { get; set; } /// /// Gets or sets the resourceGuid property of the Virtual Network /// resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// /// Gets or sets the provisioning state of the PublicIP resource. /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets a unique read-only string that changes whenever the resource /// is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGateway.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGateway.cs index 20eafd3c6c8c2..ec6849f3713ac 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGateway.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGateway.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// A common class for general resource information /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class VirtualNetworkGateway : Resource { /// @@ -26,9 +34,9 @@ public VirtualNetworkGateway() { } /// /// IP configurations for virtual /// network gateway. - /// The type of this virtual network - /// gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible - /// values include: 'Vpn', 'ExpressRoute' + /// The type of this virtual network gateway. + /// Possible values are: 'Vpn' and 'ExpressRoute'. Possible values + /// include: 'Vpn', 'ExpressRoute' /// The type of this virtual network gateway. /// Possible values are: 'PolicyBased' and 'RouteBased'. Possible /// values include: 'PolicyBased', 'RouteBased' @@ -48,8 +56,8 @@ public VirtualNetworkGateway() { } /// resource which represents the SKU selected for Virtual network /// gateway. /// The reference of the - /// VpnClientConfiguration resource which represents the P2S - /// VpnClient configurations. + /// VpnClientConfiguration resource which represents the P2S VpnClient + /// configurations. /// Virtual network gateway's BGP speaker /// settings. /// The resource GUID property of the @@ -59,7 +67,7 @@ public VirtualNetworkGateway() { } /// 'Deleting', and 'Failed'. /// Gets a unique read-only string that changes /// whenever the resource is updated. - public VirtualNetworkGateway(System.Collections.Generic.IList ipConfigurations, string gatewayType, string vpnType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), bool? enableBgp = default(bool?), bool? activeActive = default(bool?), SubResource gatewayDefaultSite = default(SubResource), VirtualNetworkGatewaySku sku = default(VirtualNetworkGatewaySku), VpnClientConfiguration vpnClientConfiguration = default(VpnClientConfiguration), BgpSettings bgpSettings = default(BgpSettings), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + public VirtualNetworkGateway(IList ipConfigurations, string gatewayType, string vpnType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), bool? enableBgp = default(bool?), bool? activeActive = default(bool?), SubResource gatewayDefaultSite = default(SubResource), VirtualNetworkGatewaySku sku = default(VirtualNetworkGatewaySku), VpnClientConfiguration vpnClientConfiguration = default(VpnClientConfiguration), BgpSettings bgpSettings = default(BgpSettings), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { IpConfigurations = ipConfigurations; @@ -79,15 +87,15 @@ public VirtualNetworkGateway() { } /// /// Gets or sets IP configurations for virtual network gateway. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] - public System.Collections.Generic.IList IpConfigurations { get; set; } + [JsonProperty(PropertyName = "properties.ipConfigurations")] + public IList IpConfigurations { get; set; } /// /// Gets or sets the type of this virtual network gateway. Possible /// values are: 'Vpn' and 'ExpressRoute'. Possible values include: /// 'Vpn', 'ExpressRoute' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayType")] + [JsonProperty(PropertyName = "properties.gatewayType")] public string GatewayType { get; set; } /// @@ -95,20 +103,20 @@ public VirtualNetworkGateway() { } /// values are: 'PolicyBased' and 'RouteBased'. Possible values /// include: 'PolicyBased', 'RouteBased' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnType")] + [JsonProperty(PropertyName = "properties.vpnType")] public string VpnType { get; set; } /// /// Gets or sets whether BGP is enabled for this virtual network /// gateway or not. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableBgp")] + [JsonProperty(PropertyName = "properties.enableBgp")] public bool? EnableBgp { get; set; } /// /// Gets or sets activeActive flag /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.activeActive")] + [JsonProperty(PropertyName = "properties.activeActive")] public bool? ActiveActive { get; set; } /// @@ -116,74 +124,73 @@ public VirtualNetworkGateway() { } /// which represents local network site having default routes. Assign /// Null value in case of removing existing default site setting. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.gatewayDefaultSite")] + [JsonProperty(PropertyName = "properties.gatewayDefaultSite")] public SubResource GatewayDefaultSite { get; set; } /// - /// Gets or sets the reference of the VirtualNetworkGatewaySku - /// resource which represents the SKU selected for Virtual network - /// gateway. + /// Gets or sets the reference of the VirtualNetworkGatewaySku resource + /// which represents the SKU selected for Virtual network gateway. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sku")] + [JsonProperty(PropertyName = "properties.sku")] public VirtualNetworkGatewaySku Sku { get; set; } /// /// Gets or sets the reference of the VpnClientConfiguration resource /// which represents the P2S VpnClient configurations. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vpnClientConfiguration")] + [JsonProperty(PropertyName = "properties.vpnClientConfiguration")] public VpnClientConfiguration VpnClientConfiguration { get; set; } /// /// Gets or sets virtual network gateway's BGP speaker settings. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bgpSettings")] + [JsonProperty(PropertyName = "properties.bgpSettings")] public BgpSettings BgpSettings { get; set; } /// /// Gets or sets the resource GUID property of the /// VirtualNetworkGateway resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// /// Gets the provisioning state of the VirtualNetworkGateway resource. /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; protected set; } /// /// Gets a unique read-only string that changes whenever the resource /// is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (IpConfigurations == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "IpConfigurations"); + throw new ValidationException(ValidationRules.CannotBeNull, "IpConfigurations"); } if (GatewayType == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "GatewayType"); + throw new ValidationException(ValidationRules.CannotBeNull, "GatewayType"); } if (VpnType == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "VpnType"); + throw new ValidationException(ValidationRules.CannotBeNull, "VpnType"); } - if (this.IpConfigurations != null) + if (IpConfigurations != null) { - foreach (var element in this.IpConfigurations) + foreach (var element in IpConfigurations) { if (element != null) { @@ -191,10 +198,11 @@ public virtual void Validate() } } } - if (this.Sku != null) + if (Sku != null) { - this.Sku.Validate(); + Sku.Validate(); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnection.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnection.cs index 4874f6d8b9b6d..bc1fc82be665c 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnection.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnection.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// A common class for general resource information /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class VirtualNetworkGatewayConnection : Resource { /// @@ -46,8 +54,8 @@ public VirtualNetworkGatewayConnection() { } /// connection health status. /// The egress bytes transferred /// in this connection. - /// The ingress bytes - /// transferred in this connection. + /// The ingress bytes transferred + /// in this connection. /// The reference to peerings resource. /// EnableBgp flag /// The resource GUID property of the @@ -57,7 +65,7 @@ public VirtualNetworkGatewayConnection() { } /// 'Updating', 'Deleting', and 'Failed'. /// Gets a unique read-only string that changes /// whenever the resource is updated. - public VirtualNetworkGatewayConnection(VirtualNetworkGateway virtualNetworkGateway1, string connectionType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string authorizationKey = default(string), VirtualNetworkGateway virtualNetworkGateway2 = default(VirtualNetworkGateway), LocalNetworkGateway localNetworkGateway2 = default(LocalNetworkGateway), int? routingWeight = default(int?), string sharedKey = default(string), string connectionStatus = default(string), System.Collections.Generic.IList tunnelConnectionStatus = default(System.Collections.Generic.IList), long? egressBytesTransferred = default(long?), long? ingressBytesTransferred = default(long?), SubResource peer = default(SubResource), bool? enableBgp = default(bool?), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + public VirtualNetworkGatewayConnection(VirtualNetworkGateway virtualNetworkGateway1, string connectionType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string authorizationKey = default(string), VirtualNetworkGateway virtualNetworkGateway2 = default(VirtualNetworkGateway), LocalNetworkGateway localNetworkGateway2 = default(LocalNetworkGateway), int? routingWeight = default(int?), string sharedKey = default(string), string connectionStatus = default(string), IList tunnelConnectionStatus = default(IList), long? egressBytesTransferred = default(long?), long? ingressBytesTransferred = default(long?), SubResource peer = default(SubResource), bool? enableBgp = default(bool?), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { AuthorizationKey = authorizationKey; @@ -81,88 +89,88 @@ public VirtualNetworkGatewayConnection() { } /// /// Gets or sets the authorizationKey. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.authorizationKey")] + [JsonProperty(PropertyName = "properties.authorizationKey")] public string AuthorizationKey { get; set; } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualNetworkGateway1")] + [JsonProperty(PropertyName = "properties.virtualNetworkGateway1")] public VirtualNetworkGateway VirtualNetworkGateway1 { get; set; } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualNetworkGateway2")] + [JsonProperty(PropertyName = "properties.virtualNetworkGateway2")] public VirtualNetworkGateway VirtualNetworkGateway2 { get; set; } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.localNetworkGateway2")] + [JsonProperty(PropertyName = "properties.localNetworkGateway2")] public LocalNetworkGateway LocalNetworkGateway2 { get; set; } /// /// Gets or sets gateway connection type. Possible values are: - /// 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible - /// values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + /// 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + /// include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionType")] + [JsonProperty(PropertyName = "properties.connectionType")] public string ConnectionType { get; set; } /// /// Gets or sets the routing weight. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.routingWeight")] + [JsonProperty(PropertyName = "properties.routingWeight")] public int? RoutingWeight { get; set; } /// /// Gets or sets the IPSec shared key. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sharedKey")] + [JsonProperty(PropertyName = "properties.sharedKey")] public string SharedKey { get; set; } /// - /// Gets virtual network Gateway connection status. Possible values - /// are 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. - /// Possible values include: 'Unknown', 'Connecting', 'Connected', + /// Gets virtual network Gateway connection status. Possible values are + /// 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible + /// values include: 'Unknown', 'Connecting', 'Connected', /// 'NotConnected' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionStatus")] - public string ConnectionStatus { get; private set; } + [JsonProperty(PropertyName = "properties.connectionStatus")] + public string ConnectionStatus { get; protected set; } /// /// Gets collection of all tunnels' connection health status. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.tunnelConnectionStatus")] - public System.Collections.Generic.IList TunnelConnectionStatus { get; private set; } + [JsonProperty(PropertyName = "properties.tunnelConnectionStatus")] + public IList TunnelConnectionStatus { get; protected set; } /// /// Gets the egress bytes transferred in this connection. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.egressBytesTransferred")] - public long? EgressBytesTransferred { get; private set; } + [JsonProperty(PropertyName = "properties.egressBytesTransferred")] + public long? EgressBytesTransferred { get; protected set; } /// /// Gets the ingress bytes transferred in this connection. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ingressBytesTransferred")] - public long? IngressBytesTransferred { get; private set; } + [JsonProperty(PropertyName = "properties.ingressBytesTransferred")] + public long? IngressBytesTransferred { get; protected set; } /// /// Gets or sets the reference to peerings resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peer")] + [JsonProperty(PropertyName = "properties.peer")] public SubResource Peer { get; set; } /// /// Gets or sets enableBgp flag /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableBgp")] + [JsonProperty(PropertyName = "properties.enableBgp")] public bool? EnableBgp { get; set; } /// /// Gets or sets the resource GUID property of the /// VirtualNetworkGatewayConnection resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGuid")] + [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// @@ -170,44 +178,45 @@ public VirtualNetworkGatewayConnection() { } /// resource. Possible values are: 'Updating', 'Deleting', and /// 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; protected set; } /// /// Gets a unique read-only string that changes whenever the resource /// is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (VirtualNetworkGateway1 == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "VirtualNetworkGateway1"); + throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetworkGateway1"); } if (ConnectionType == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ConnectionType"); + throw new ValidationException(ValidationRules.CannotBeNull, "ConnectionType"); } - if (this.VirtualNetworkGateway1 != null) + if (VirtualNetworkGateway1 != null) { - this.VirtualNetworkGateway1.Validate(); + VirtualNetworkGateway1.Validate(); } - if (this.VirtualNetworkGateway2 != null) + if (VirtualNetworkGateway2 != null) { - this.VirtualNetworkGateway2.Validate(); + VirtualNetworkGateway2.Validate(); } - if (this.LocalNetworkGateway2 != null) + if (LocalNetworkGateway2 != null) { - this.LocalNetworkGateway2.Validate(); + LocalNetworkGateway2.Validate(); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionStatus.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionStatus.cs index 2c3585457379a..12de02e6b839e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionStatus.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionStatus.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for VirtualNetworkGatewayConnectionStatus. @@ -20,3 +23,4 @@ public static class VirtualNetworkGatewayConnectionStatus public const string NotConnected = "NotConnected"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionType.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionType.cs index 525326bb08890..b9b195c21d7d5 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionType.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionType.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for VirtualNetworkGatewayConnectionType. @@ -20,3 +23,4 @@ public static class VirtualNetworkGatewayConnectionType public const string VPNClient = "VPNClient"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs index b3d7ae02519ff..2a2154d0a8372 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// IP configuration for virtual network gateway /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class VirtualNetworkGatewayIPConfiguration : SubResource { /// @@ -36,8 +42,8 @@ public VirtualNetworkGatewayIPConfiguration() { } /// The provisioning state of the /// public IP resource. Possible values are: 'Updating', 'Deleting', /// and 'Failed'. - /// The name of the resource that is unique within - /// a resource group. This name can be used to access the + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the /// resource. /// A unique read-only string that changes whenever /// the resource is updated. @@ -53,62 +59,63 @@ public VirtualNetworkGatewayIPConfiguration() { } } /// - /// Gets or sets the private IP allocation method. Possible values - /// are: 'Static' and 'Dynamic'. Possible values include: 'Static', + /// Gets or sets the private IP allocation method. Possible values are: + /// 'Static' and 'Dynamic'. Possible values include: 'Static', /// 'Dynamic' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] + [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] public string PrivateIPAllocationMethod { get; set; } /// /// Gets or sets the reference of the subnet resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + [JsonProperty(PropertyName = "properties.subnet")] public SubResource Subnet { get; set; } /// /// Gets or sets the reference of the public IP resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddress")] + [JsonProperty(PropertyName = "properties.publicIPAddress")] public SubResource PublicIPAddress { get; set; } /// /// Gets the provisioning state of the public IP resource. Possible /// values are: 'Updating', 'Deleting', and 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; protected set; } /// /// Gets or sets the name of the resource that is unique within a /// resource group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (Subnet == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Subnet"); + throw new ValidationException(ValidationRules.CannotBeNull, "Subnet"); } if (PublicIPAddress == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PublicIPAddress"); + throw new ValidationException(ValidationRules.CannotBeNull, "PublicIPAddress"); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySku.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySku.cs index 02f293f3a0229..bdf95f3f30818 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySku.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySku.cs @@ -1,13 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -45,7 +50,7 @@ public VirtualNetworkGatewaySku() { } /// values include: 'Basic', 'HighPerformance', 'Standard', /// 'UltraPerformance' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// @@ -54,31 +59,32 @@ public VirtualNetworkGatewaySku() { } /// values include: 'Basic', 'HighPerformance', 'Standard', /// 'UltraPerformance' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + [JsonProperty(PropertyName = "tier")] public string Tier { get; set; } /// /// Gets or sets the capacity. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "capacity")] + [JsonProperty(PropertyName = "capacity")] public int? Capacity { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (Name == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); } if (Tier == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Tier"); + throw new ValidationException(ValidationRules.CannotBeNull, "Tier"); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuName.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuName.cs index 6e0ac5abb4d5d..4bfa82f7c3ae1 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuName.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuName.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for VirtualNetworkGatewaySkuName. @@ -20,3 +23,4 @@ public static class VirtualNetworkGatewaySkuName public const string UltraPerformance = "UltraPerformance"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuTier.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuTier.cs index ea97c0d44f214..b9864a3f8f317 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuTier.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuTier.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for VirtualNetworkGatewaySkuTier. @@ -20,3 +23,4 @@ public static class VirtualNetworkGatewaySkuTier public const string UltraPerformance = "UltraPerformance"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayType.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayType.cs index 30cd52ccd1da1..9d561301add9a 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayType.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayType.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for VirtualNetworkGatewayType. @@ -18,3 +21,4 @@ public static class VirtualNetworkGatewayType public const string ExpressRoute = "ExpressRoute"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeering.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeering.cs index c2e997911db97..025dfd522ac65 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeering.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeering.cs @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// Peerings in a virtual network resource. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class VirtualNetworkPeering : SubResource { /// @@ -26,8 +32,8 @@ public VirtualNetworkPeering() { } /// /// Resource ID. /// Whether the VMs in the - /// linked virtual network space would be able to access all the VMs - /// in local Virtual network space. + /// linked virtual network space would be able to access all the VMs in + /// local Virtual network space. /// Whether the forwarded traffic /// from the VMs in the remote virtual network will be /// allowed/disallowed. @@ -35,20 +41,20 @@ public VirtualNetworkPeering() { } /// remote virtual networking to link to this virtual network. /// If remote gateways can be used on /// this virtual network. If the flag is set to true, and - /// allowGatewayTransit on remote peering is also true, virtual - /// network will use gateways of remote virtual network for transit. - /// Only one peering can have this flag set to true. This flag cannot - /// be set if virtual network already has a gateway. + /// allowGatewayTransit on remote peering is also true, virtual network + /// will use gateways of remote virtual network for transit. Only one + /// peering can have this flag set to true. This flag cannot be set if + /// virtual network already has a gateway. /// The reference of the remote /// virtual network. /// The status of the virtual network /// peering. Possible values are 'Initiated', 'Connected', and - /// 'Disconnected'. Possible values include: 'Initiated', - /// 'Connected', 'Disconnected' + /// 'Disconnected'. Possible values include: 'Initiated', 'Connected', + /// 'Disconnected' /// The provisioning state of the /// resource. - /// The name of the resource that is unique within - /// a resource group. This name can be used to access the + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the /// resource. /// A unique read-only string that changes whenever /// the resource is updated. @@ -68,41 +74,40 @@ public VirtualNetworkPeering() { } /// /// Gets or sets whether the VMs in the linked virtual network space - /// would be able to access all the VMs in local Virtual network - /// space. + /// would be able to access all the VMs in local Virtual network space. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowVirtualNetworkAccess")] + [JsonProperty(PropertyName = "properties.allowVirtualNetworkAccess")] public bool? AllowVirtualNetworkAccess { get; set; } /// /// Gets or sets whether the forwarded traffic from the VMs in the /// remote virtual network will be allowed/disallowed. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowForwardedTraffic")] + [JsonProperty(PropertyName = "properties.allowForwardedTraffic")] public bool? AllowForwardedTraffic { get; set; } /// /// Gets or sets if gateway links can be used in remote virtual /// networking to link to this virtual network. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowGatewayTransit")] + [JsonProperty(PropertyName = "properties.allowGatewayTransit")] public bool? AllowGatewayTransit { get; set; } /// /// Gets or sets if remote gateways can be used on this virtual /// network. If the flag is set to true, and allowGatewayTransit on /// remote peering is also true, virtual network will use gateways of - /// remote virtual network for transit. Only one peering can have - /// this flag set to true. This flag cannot be set if virtual network + /// remote virtual network for transit. Only one peering can have this + /// flag set to true. This flag cannot be set if virtual network /// already has a gateway. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.useRemoteGateways")] + [JsonProperty(PropertyName = "properties.useRemoteGateways")] public bool? UseRemoteGateways { get; set; } /// /// Gets or sets the reference of the remote virtual network. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.remoteVirtualNetwork")] + [JsonProperty(PropertyName = "properties.remoteVirtualNetwork")] public SubResource RemoteVirtualNetwork { get; set; } /// @@ -110,28 +115,29 @@ public VirtualNetworkPeering() { } /// values are 'Initiated', 'Connected', and 'Disconnected'. Possible /// values include: 'Initiated', 'Connected', 'Disconnected' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.peeringState")] + [JsonProperty(PropertyName = "properties.peeringState")] public string PeeringState { get; set; } /// /// Gets or sets the provisioning state of the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets the name of the resource that is unique within a /// resource group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeeringState.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeeringState.cs index 75b43119ac948..7d3bcce13a86e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeeringState.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeeringState.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for VirtualNetworkPeeringState. @@ -19,3 +22,4 @@ public static class VirtualNetworkPeeringState public const string Disconnected = "Disconnected"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientConfiguration.cs index 2f85b903b7208..44504d2731029 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientConfiguration.cs @@ -1,13 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -29,9 +35,9 @@ public VpnClientConfiguration() { } /// VpnClientRootCertificate /// for virtual network gateway. /// VpnClientRevokedCertificate - /// for Virtual network gateway. - public VpnClientConfiguration(AddressSpace vpnClientAddressPool = default(AddressSpace), System.Collections.Generic.IList vpnClientRootCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList vpnClientRevokedCertificates = default(System.Collections.Generic.IList)) + /// name="vpnClientRevokedCertificates">VpnClientRevokedCertificate for + /// Virtual network gateway. + public VpnClientConfiguration(AddressSpace vpnClientAddressPool = default(AddressSpace), IList vpnClientRootCertificates = default(IList), IList vpnClientRevokedCertificates = default(IList)) { VpnClientAddressPool = vpnClientAddressPool; VpnClientRootCertificates = vpnClientRootCertificates; @@ -42,21 +48,22 @@ public VpnClientConfiguration() { } /// Gets or sets the reference of the address space resource which /// represents Address space for P2S VpnClient. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "vpnClientAddressPool")] + [JsonProperty(PropertyName = "vpnClientAddressPool")] public AddressSpace VpnClientAddressPool { get; set; } /// /// Gets or sets vpnClientRootCertificate for virtual network gateway. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "vpnClientRootCertificates")] - public System.Collections.Generic.IList VpnClientRootCertificates { get; set; } + [JsonProperty(PropertyName = "vpnClientRootCertificates")] + public IList VpnClientRootCertificates { get; set; } /// /// Gets or sets vpnClientRevokedCertificate for Virtual network /// gateway. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "vpnClientRevokedCertificates")] - public System.Collections.Generic.IList VpnClientRevokedCertificates { get; set; } + [JsonProperty(PropertyName = "vpnClientRevokedCertificates")] + public IList VpnClientRevokedCertificates { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientParameters.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientParameters.cs index 2642891c850ac..5fae80b656596 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientParameters.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientParameters.cs @@ -1,13 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -35,21 +40,22 @@ public VpnClientParameters(string processorArchitecture) /// Gets or sets VPN client Processor Architecture. Possible values /// are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ProcessorArchitecture")] + [JsonProperty(PropertyName = "ProcessorArchitecture")] public string ProcessorArchitecture { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (ProcessorArchitecture == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ProcessorArchitecture"); + throw new ValidationException(ValidationRules.CannotBeNull, "ProcessorArchitecture"); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRevokedCertificate.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRevokedCertificate.cs index 980ac32111bc3..4b0a7e9148e86 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRevokedCertificate.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRevokedCertificate.cs @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// VPN client revoked certificate of virtual network gateway. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class VpnClientRevokedCertificate : SubResource { /// @@ -32,8 +38,8 @@ public VpnClientRevokedCertificate() { } /// The provisioning state of the VPN /// client revoked certificate resource. Possible values are: /// 'Updating', 'Deleting', and 'Failed'. - /// The name of the resource that is unique within - /// a resource group. This name can be used to access the + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the /// resource. /// A unique read-only string that changes whenever /// the resource is updated. @@ -49,7 +55,7 @@ public VpnClientRevokedCertificate() { } /// /// Gets or sets the revoked VPN client certificate thumbprint. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.thumbprint")] + [JsonProperty(PropertyName = "properties.thumbprint")] public string Thumbprint { get; set; } /// @@ -57,22 +63,23 @@ public VpnClientRevokedCertificate() { } /// resource. Possible values are: 'Updating', 'Deleting', and /// 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; protected set; } /// /// Gets or sets the name of the resource that is unique within a /// resource group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRootCertificate.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRootCertificate.cs index 5e389c1f28dad..a94d64a764d69 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRootCertificate.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRootCertificate.cs @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; using System.Linq; /// /// VPN client root certificate of virtual network gateway /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class VpnClientRootCertificate : SubResource { /// @@ -27,10 +33,10 @@ public VpnClientRootCertificate() { } /// The certificate public data. /// Resource ID. /// The provisioning state of the VPN - /// client root certificate resource. Possible values are: - /// 'Updating', 'Deleting', and 'Failed'. - /// The name of the resource that is unique within - /// a resource group. This name can be used to access the + /// client root certificate resource. Possible values are: 'Updating', + /// 'Deleting', and 'Failed'. + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the /// resource. /// A unique read-only string that changes whenever /// the resource is updated. @@ -46,7 +52,7 @@ public VpnClientRootCertificate() { } /// /// Gets or sets the certificate public data. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicCertData")] + [JsonProperty(PropertyName = "properties.publicCertData")] public string PublicCertData { get; set; } /// @@ -54,35 +60,36 @@ public VpnClientRootCertificate() { } /// resource. Possible values are: 'Updating', 'Deleting', and /// 'Failed'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; protected set; } /// /// Gets or sets the name of the resource that is unique within a /// resource group. This name can be used to access the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (PublicCertData == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PublicCertData"); + throw new ValidationException(ValidationRules.CannotBeNull, "PublicCertData"); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnType.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnType.cs index ba5c7ac470990..2c0724c627d18 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnType.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnType.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { + using Azure; + using Management; + using Network; /// /// Defines values for VpnType. @@ -18,3 +21,4 @@ public static class VpnType public const string RouteBased = "RouteBased"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperations.cs index 1e8cb6faaec85..8dc3c53c36ed8 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// NetworkInterfacesOperations operations. /// - internal partial class NetworkInterfacesOperations : Microsoft.Rest.IServiceOperations, INetworkInterfacesOperations + internal partial class NetworkInterfacesOperations : IServiceOperations, INetworkInterfacesOperations { /// /// Initializes a new instance of the NetworkInterfacesOperations class. @@ -29,11 +38,11 @@ internal partial class NetworkInterfacesOperations : Microsoft.Rest.IServiceOper /// internal NetworkInterfacesOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -56,16 +65,16 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, networkInterfaceName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// Deletes the specified network interface. + /// Gets information about the specified network interface. /// /// /// The name of the resource group. @@ -73,83 +82,97 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The name of the network interface. /// + /// + /// Expands referenced resources. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (networkInterfaceName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -166,43 +189,51 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + 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; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,22 +243,40 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets information about the specified network interface. + /// Creates or updates a network interface. /// /// /// The name of the resource group. @@ -235,8 +284,37 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The name of the network interface. /// - /// - /// Expands referenced resources. + /// + /// Parameters supplied to the create or update network interface operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, networkInterfaceName, parameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set. + /// + /// + /// The virtual machine index. /// /// /// Headers that will be added to request. @@ -244,85 +322,89 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListVirtualMachineScaleSetVMNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (networkInterfaceName == null) + if (virtualMachineScaleSetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); + } + if (virtualmachineIndex == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualmachineIndex"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkInterfaceName", networkInterfaceName); - tracingParameters.Add("expand", expand); + tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); + tracingParameters.Add("virtualmachineIndex", virtualmachineIndex); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetVMNetworkInterfaces", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); - } - if (expand != null) + _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); + _url = _url.Replace("{virtualmachineIndex}", System.Uri.EscapeDataString(virtualmachineIndex)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -339,35 +421,35 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -375,15 +457,15 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -393,7 +475,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -406,7 +488,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -415,55 +497,24 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Creates or updates a network interface. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// Parameters supplied to the create or update network interface operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, networkInterfaceName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// Creates or updates a network interface. + /// Gets all network interfaces in a virtual machine scale set. /// /// /// The name of the resource group. /// - /// - /// The name of the network interface. - /// - /// - /// Parameters supplied to the create or update network interface operation. + /// + /// The name of the virtual machine scale set. /// /// /// Headers that will be added to request. @@ -471,85 +522,83 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListVirtualMachineScaleSetNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkInterfaceName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + if (virtualMachineScaleSetName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkInterfaceName", networkInterfaceName); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetNetworkInterfaces", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -565,42 +614,36 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -608,15 +651,15 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -626,7 +669,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -634,30 +677,12 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -666,19 +691,18 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets information about all network interfaces in a virtual machine in a - /// virtual machine scale set. + /// Get the specified network interface in a virtual machine scale set. /// /// /// The name of the resource group. @@ -689,92 +713,112 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The virtual machine index. /// + /// + /// The name of the network interface. + /// + /// + /// Expands referenced resources. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListVirtualMachineScaleSetVMNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetVirtualMachineScaleSetNetworkInterfaceWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualMachineScaleSetName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); } if (virtualmachineIndex == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualmachineIndex"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualmachineIndex"); } - if (this.Client.ApiVersion == null) + if (networkInterfaceName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); } - if (this.Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); tracingParameters.Add("virtualmachineIndex", virtualmachineIndex); + tracingParameters.Add("networkInterfaceName", networkInterfaceName); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetVMNetworkInterfaces", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetVirtualMachineScaleSetNetworkInterface", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); _url = _url.Replace("{virtualmachineIndex}", System.Uri.EscapeDataString(virtualmachineIndex)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -791,35 +835,35 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -827,15 +871,15 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -845,7 +889,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -858,7 +902,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -867,105 +911,90 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all network interfaces in a virtual machine scale set. + /// Gets all network interfaces in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual machine scale set. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListVirtualMachineScaleSetNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (virtualMachineScaleSetName == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.ApiVersion == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetNetworkInterfaces", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -982,35 +1011,35 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1018,15 +1047,15 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1036,7 +1065,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1049,7 +1078,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1058,131 +1087,99 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Get the specified network interface in a virtual machine scale set. + /// Gets all network interfaces in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the virtual machine scale set. - /// - /// - /// The virtual machine index. - /// - /// - /// The name of the network interface. - /// - /// - /// Expands referenced resources. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetVirtualMachineScaleSetNetworkInterfaceWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualMachineScaleSetName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); - } - if (virtualmachineIndex == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualmachineIndex"); - } - if (networkInterfaceName == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.ApiVersion == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); - tracingParameters.Add("virtualmachineIndex", virtualmachineIndex); - tracingParameters.Add("networkInterfaceName", networkInterfaceName); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetVirtualMachineScaleSetNetworkInterface", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); - _url = _url.Replace("{virtualmachineIndex}", System.Uri.EscapeDataString(virtualmachineIndex)); - _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); - } - if (expand != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1199,35 +1196,35 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1235,15 +1232,15 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1253,7 +1250,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1266,7 +1263,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1275,87 +1272,151 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all network interfaces in a subscription. + /// Gets all route tables applied to a network interface. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> GetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginGetEffectiveRouteTableWithHttpMessagesAsync( + resourceGroupName, networkInterfaceName, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// Gets all network security groups applied to a network interface. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync( + resourceGroupName, networkInterfaceName, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// Deletes the specified network interface. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when 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 System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.ApiVersion == null) + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkInterfaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + } + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1372,51 +1433,43 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (Newtonsoft.Json.JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1426,118 +1479,120 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all network interfaces in a resource group. + /// Creates or updates a network interface. /// /// /// The name of the resource group. /// + /// + /// The name of the network interface. + /// + /// + /// Parameters supplied to the create or update network interface operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkInterfaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkInterfaceName", networkInterfaceName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1553,36 +1608,42 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 201 && (int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1590,15 +1651,15 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1608,7 +1669,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1616,12 +1677,30 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1630,39 +1709,16 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } - /// - /// Gets all route tables applied to a network interface. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> GetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetEffectiveRouteTableWithHttpMessagesAsync( - resourceGroupName, networkInterfaceName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - /// /// Gets all route tables applied to a network interface. /// @@ -1678,80 +1734,83 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginGetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginGetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (networkInterfaceName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetEffectiveRouteTable", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginGetEffectiveRouteTable", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1768,35 +1827,35 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1804,15 +1863,15 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1822,7 +1881,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1835,7 +1894,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1844,39 +1903,16 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } - /// - /// Gets all network security groups applied to a network interface. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync( - resourceGroupName, networkInterfaceName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - /// /// Gets all network security groups applied to a network interface. /// @@ -1892,80 +1928,83 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (networkInterfaceName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListEffectiveNetworkSecurityGroups", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginListEffectiveNetworkSecurityGroups", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1982,35 +2021,35 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2018,15 +2057,15 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2036,7 +2075,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2049,7 +2088,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2058,12 +2097,12 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2081,60 +2120,63 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetVMNetworkInterfacesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetVMNetworkInterfacesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -2151,35 +2193,35 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2187,15 +2229,15 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2205,7 +2247,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2218,7 +2260,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2227,12 +2269,12 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2249,60 +2291,63 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListVirtualMachineScaleSetNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListVirtualMachineScaleSetNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetNetworkInterfacesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetNetworkInterfacesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -2319,35 +2364,35 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2355,15 +2400,15 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2373,7 +2418,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2386,7 +2431,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2395,12 +2440,12 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2417,60 +2462,63 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -2487,35 +2535,35 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2523,15 +2571,15 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2541,7 +2589,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2554,7 +2602,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2563,12 +2611,12 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2585,60 +2633,63 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -2655,35 +2706,35 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2691,15 +2742,15 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2709,7 +2760,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2722,7 +2773,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2731,15 +2782,16 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperationsExtensions.cs index dd3d6b6667496..eec00ec48d67c 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for NetworkInterfacesOperations. @@ -31,7 +35,7 @@ public static partial class NetworkInterfacesOperationsExtensions /// public static void Delete(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).DeleteAsync(resourceGroupName, networkInterfaceName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).DeleteAsync(resourceGroupName, networkInterfaceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -49,48 +53,11 @@ public static void Delete(this INetworkInterfacesOperations operations, string r /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false); } - /// - /// Deletes the specified network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - public static void BeginDelete(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) - { - System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginDeleteAsync(resourceGroupName, networkInterfaceName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false); - } - /// /// Gets information about the specified network interface. /// @@ -108,7 +75,7 @@ public static void BeginDelete(this INetworkInterfacesOperations operations, str /// public static NetworkInterface Get(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, string expand = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).GetAsync(resourceGroupName, networkInterfaceName, expand), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).GetAsync(resourceGroupName, networkInterfaceName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -129,7 +96,7 @@ public static void BeginDelete(this INetworkInterfacesOperations operations, str /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, expand, null, cancellationToken).ConfigureAwait(false)) { @@ -154,7 +121,7 @@ public static void BeginDelete(this INetworkInterfacesOperations operations, str /// public static NetworkInterface CreateOrUpdate(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).CreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).CreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -175,7 +142,7 @@ public static NetworkInterface CreateOrUpdate(this INetworkInterfacesOperations /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -183,52 +150,6 @@ public static NetworkInterface CreateOrUpdate(this INetworkInterfacesOperations } } - /// - /// Creates or updates a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// Parameters supplied to the create or update network interface operation. - /// - public static NetworkInterface BeginCreateOrUpdate(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters) - { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// Parameters supplied to the create or update network interface operation. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets information about all network interfaces in a virtual machine in a /// virtual machine scale set. @@ -245,9 +166,9 @@ public static NetworkInterface BeginCreateOrUpdate(this INetworkInterfacesOperat /// /// The virtual machine index. /// - public static Microsoft.Rest.Azure.IPage ListVirtualMachineScaleSetVMNetworkInterfaces(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex) + public static IPage ListVirtualMachineScaleSetVMNetworkInterfaces(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListVirtualMachineScaleSetVMNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListVirtualMachineScaleSetVMNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -269,7 +190,7 @@ public static Microsoft.Rest.Azure.IPage ListVirtualMachineSca /// /// The cancellation token. /// - public static async Task> ListVirtualMachineScaleSetVMNetworkInterfacesAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListVirtualMachineScaleSetVMNetworkInterfacesAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListVirtualMachineScaleSetVMNetworkInterfacesWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, null, cancellationToken).ConfigureAwait(false)) { @@ -289,9 +210,9 @@ public static Microsoft.Rest.Azure.IPage ListVirtualMachineSca /// /// The name of the virtual machine scale set. /// - public static Microsoft.Rest.Azure.IPage ListVirtualMachineScaleSetNetworkInterfaces(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName) + public static IPage ListVirtualMachineScaleSetNetworkInterfaces(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListVirtualMachineScaleSetNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListVirtualMachineScaleSetNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -309,7 +230,7 @@ public static Microsoft.Rest.Azure.IPage ListVirtualMachineSca /// /// The cancellation token. /// - public static async Task> ListVirtualMachineScaleSetNetworkInterfacesAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListVirtualMachineScaleSetNetworkInterfacesAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListVirtualMachineScaleSetNetworkInterfacesWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, null, cancellationToken).ConfigureAwait(false)) { @@ -340,7 +261,7 @@ public static Microsoft.Rest.Azure.IPage ListVirtualMachineSca /// public static NetworkInterface GetVirtualMachineScaleSetNetworkInterface(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).GetVirtualMachineScaleSetNetworkInterfaceAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).GetVirtualMachineScaleSetNetworkInterfaceAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -367,7 +288,7 @@ public static Microsoft.Rest.Azure.IPage ListVirtualMachineSca /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetVirtualMachineScaleSetNetworkInterfaceAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetVirtualMachineScaleSetNetworkInterfaceAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetVirtualMachineScaleSetNetworkInterfaceWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand, null, cancellationToken).ConfigureAwait(false)) { @@ -381,9 +302,9 @@ public static Microsoft.Rest.Azure.IPage ListVirtualMachineSca /// /// The operations group for this extension method. /// - public static Microsoft.Rest.Azure.IPage ListAll(this INetworkInterfacesOperations operations) + public static IPage ListAll(this INetworkInterfacesOperations operations) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListAllAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -395,7 +316,7 @@ public static Microsoft.Rest.Azure.IPage ListAll(this INetwork /// /// The cancellation token. /// - public static async Task> ListAllAsync(this INetworkInterfacesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAllAsync(this INetworkInterfacesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -412,9 +333,9 @@ public static Microsoft.Rest.Azure.IPage ListAll(this INetwork /// /// The name of the resource group. /// - public static Microsoft.Rest.Azure.IPage List(this INetworkInterfacesOperations operations, string resourceGroupName) + public static IPage List(this INetworkInterfacesOperations operations, string resourceGroupName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -429,7 +350,7 @@ public static Microsoft.Rest.Azure.IPage List(this INetworkInt /// /// The cancellation token. /// - public static async Task> ListAsync(this INetworkInterfacesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this INetworkInterfacesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { @@ -451,7 +372,7 @@ public static Microsoft.Rest.Azure.IPage List(this INetworkInt /// public static EffectiveRouteListResult GetEffectiveRouteTable(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).GetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).GetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -469,7 +390,7 @@ public static EffectiveRouteListResult GetEffectiveRouteTable(this INetworkInter /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetEffectiveRouteTableAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetEffectiveRouteTableAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetEffectiveRouteTableWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { @@ -478,7 +399,7 @@ public static EffectiveRouteListResult GetEffectiveRouteTable(this INetworkInter } /// - /// Gets all route tables applied to a network interface. + /// Gets all network security groups applied to a network interface. /// /// /// The operations group for this extension method. @@ -489,13 +410,13 @@ public static EffectiveRouteListResult GetEffectiveRouteTable(this INetworkInter /// /// The name of the network interface. /// - public static EffectiveRouteListResult BeginGetEffectiveRouteTable(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + public static EffectiveNetworkSecurityGroupListResult ListEffectiveNetworkSecurityGroups(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all route tables applied to a network interface. + /// Gets all network security groups applied to a network interface. /// /// /// The operations group for this extension method. @@ -509,16 +430,16 @@ public static EffectiveRouteListResult BeginGetEffectiveRouteTable(this INetwork /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginGetEffectiveRouteTableAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task ListEffectiveNetworkSecurityGroupsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginGetEffectiveRouteTableWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets all network security groups applied to a network interface. + /// Deletes the specified network interface. /// /// /// The operations group for this extension method. @@ -529,13 +450,13 @@ public static EffectiveRouteListResult BeginGetEffectiveRouteTable(this INetwork /// /// The name of the network interface. /// - public static EffectiveNetworkSecurityGroupListResult ListEffectiveNetworkSecurityGroups(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + public static void BeginDelete(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginDeleteAsync(resourceGroupName, networkInterfaceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all network security groups applied to a network interface. + /// Deletes the specified network interface. /// /// /// The operations group for this extension method. @@ -549,9 +470,92 @@ public static EffectiveNetworkSecurityGroupListResult ListEffectiveNetworkSecuri /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task ListEffectiveNetworkSecurityGroupsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginDeleteAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates or updates a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// Parameters supplied to the create or update network interface operation. + /// + public static NetworkInterface BeginCreateOrUpdate(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters) + { + return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// Parameters supplied to the create or update network interface operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all route tables applied to a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + public static EffectiveRouteListResult BeginGetEffectiveRouteTable(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + { + return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Gets all route tables applied to a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The cancellation token. + /// + public static async Task BeginGetEffectiveRouteTableAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginGetEffectiveRouteTableWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -571,7 +575,7 @@ public static EffectiveNetworkSecurityGroupListResult ListEffectiveNetworkSecuri /// public static EffectiveNetworkSecurityGroupListResult BeginListEffectiveNetworkSecurityGroups(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -589,7 +593,7 @@ public static EffectiveNetworkSecurityGroupListResult BeginListEffectiveNetworkS /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginListEffectiveNetworkSecurityGroupsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginListEffectiveNetworkSecurityGroupsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { @@ -607,9 +611,9 @@ public static EffectiveNetworkSecurityGroupListResult BeginListEffectiveNetworkS /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListVirtualMachineScaleSetVMNetworkInterfacesNext(this INetworkInterfacesOperations operations, string nextPageLink) + public static IPage ListVirtualMachineScaleSetVMNetworkInterfacesNext(this INetworkInterfacesOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListVirtualMachineScaleSetVMNetworkInterfacesNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListVirtualMachineScaleSetVMNetworkInterfacesNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -625,7 +629,7 @@ public static Microsoft.Rest.Azure.IPage ListVirtualMachineSca /// /// The cancellation token. /// - public static async Task> ListVirtualMachineScaleSetVMNetworkInterfacesNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListVirtualMachineScaleSetVMNetworkInterfacesNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -642,9 +646,9 @@ public static Microsoft.Rest.Azure.IPage ListVirtualMachineSca /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListVirtualMachineScaleSetNetworkInterfacesNext(this INetworkInterfacesOperations operations, string nextPageLink) + public static IPage ListVirtualMachineScaleSetNetworkInterfacesNext(this INetworkInterfacesOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListVirtualMachineScaleSetNetworkInterfacesNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListVirtualMachineScaleSetNetworkInterfacesNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -659,7 +663,7 @@ public static Microsoft.Rest.Azure.IPage ListVirtualMachineSca /// /// The cancellation token. /// - public static async Task> ListVirtualMachineScaleSetNetworkInterfacesNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListVirtualMachineScaleSetNetworkInterfacesNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListVirtualMachineScaleSetNetworkInterfacesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -676,9 +680,9 @@ public static Microsoft.Rest.Azure.IPage ListVirtualMachineSca /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListAllNext(this INetworkInterfacesOperations operations, string nextPageLink) + public static IPage ListAllNext(this INetworkInterfacesOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListAllNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListAllNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -693,7 +697,7 @@ public static Microsoft.Rest.Azure.IPage ListAllNext(this INet /// /// The cancellation token. /// - public static async Task> ListAllNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAllNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -710,9 +714,9 @@ public static Microsoft.Rest.Azure.IPage ListAllNext(this INet /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this INetworkInterfacesOperations operations, string nextPageLink) + public static IPage ListNext(this INetworkInterfacesOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -727,7 +731,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this INetwor /// /// The cancellation token. /// - public static async Task> ListNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -737,3 +741,4 @@ public static Microsoft.Rest.Azure.IPage ListNext(this INetwor } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClient.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClient.cs index 94225d0bb2413..a506d0a8d0745 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClient.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClient.cs @@ -1,17 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Rest.Serialization; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// The Microsoft Azure Network management API provides a RESTful set of @@ -20,7 +30,7 @@ namespace Microsoft.Azure.Management.Network /// relationship between an end user and the Microsoft Azure Networks /// service. /// - public partial class NetworkManagementClient : Microsoft.Rest.ServiceClient, INetworkManagementClient, IAzureClient + public partial class NetworkManagementClient : ServiceClient, INetworkManagementClient, IAzureClient { /// /// The base URI of the service. @@ -40,7 +50,7 @@ public partial class NetworkManagementClient : Microsoft.Rest.ServiceClient /// Credentials needed for the client to connect to Azure. /// - public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } + public ServiceClientCredentials Credentials { get; private set; } /// /// The subscription credentials which uniquely identify the Microsoft Azure @@ -174,7 +184,7 @@ public partial class NetworkManagementClient : Microsoft.Rest.ServiceClient protected NetworkManagementClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { - this.Initialize(); + Initialize(); } /// @@ -188,7 +198,7 @@ protected NetworkManagementClient(params System.Net.Http.DelegatingHandler[] han /// protected NetworkManagementClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { - this.Initialize(); + Initialize(); } /// @@ -209,7 +219,7 @@ protected NetworkManagementClient(System.Uri baseUri, params System.Net.Http.Del { throw new System.ArgumentNullException("baseUri"); } - this.BaseUri = baseUri; + BaseUri = baseUri; } /// @@ -233,7 +243,7 @@ protected NetworkManagementClient(System.Uri baseUri, System.Net.Http.HttpClient { throw new System.ArgumentNullException("baseUri"); } - this.BaseUri = baseUri; + BaseUri = baseUri; } /// @@ -248,16 +258,16 @@ protected NetworkManagementClient(System.Uri baseUri, System.Net.Http.HttpClient /// /// Thrown when a required parameter is null /// - public NetworkManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + public NetworkManagementClient(ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - this.Credentials = credentials; - if (this.Credentials != null) + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -276,16 +286,16 @@ public NetworkManagementClient(Microsoft.Rest.ServiceClientCredentials credentia /// /// Thrown when a required parameter is null /// - public NetworkManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + public NetworkManagementClient(ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - this.Credentials = credentials; - if (this.Credentials != null) + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -304,7 +314,7 @@ public NetworkManagementClient(Microsoft.Rest.ServiceClientCredentials credentia /// /// Thrown when a required parameter is null /// - public NetworkManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + public NetworkManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -314,11 +324,11 @@ public NetworkManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientC { throw new System.ArgumentNullException("credentials"); } - this.BaseUri = baseUri; - this.Credentials = credentials; - if (this.Credentials != null) + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -340,7 +350,7 @@ public NetworkManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientC /// /// Thrown when a required parameter is null /// - public NetworkManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + public NetworkManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -350,11 +360,11 @@ public NetworkManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientC { throw new System.ArgumentNullException("credentials"); } - this.BaseUri = baseUri; - this.Credentials = credentials; - if (this.Credentials != null) + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -367,30 +377,30 @@ public NetworkManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientC /// private void Initialize() { - this.ApplicationGateways = new ApplicationGatewaysOperations(this); - this.ExpressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationsOperations(this); - this.ExpressRouteCircuitPeerings = new ExpressRouteCircuitPeeringsOperations(this); - this.ExpressRouteCircuits = new ExpressRouteCircuitsOperations(this); - this.ExpressRouteServiceProviders = new ExpressRouteServiceProvidersOperations(this); - this.LoadBalancers = new LoadBalancersOperations(this); - this.LocalNetworkGateways = new LocalNetworkGatewaysOperations(this); - this.NetworkInterfaces = new NetworkInterfacesOperations(this); - this.NetworkSecurityGroups = new NetworkSecurityGroupsOperations(this); - this.PublicIPAddresses = new PublicIPAddressesOperations(this); - this.RouteTables = new RouteTablesOperations(this); - this.Routes = new RoutesOperations(this); - this.SecurityRules = new SecurityRulesOperations(this); - this.Subnets = new SubnetsOperations(this); - this.VirtualNetworkPeerings = new VirtualNetworkPeeringsOperations(this); - this.Usages = new UsagesOperations(this); - this.VirtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionsOperations(this); - this.VirtualNetworkGateways = new VirtualNetworkGatewaysOperations(this); - this.VirtualNetworks = new VirtualNetworksOperations(this); - this.BaseUri = new System.Uri("https://management.azure.com"); - this.ApiVersion = "2016-09-01"; - this.AcceptLanguage = "en-US"; - this.LongRunningOperationRetryTimeout = 30; - this.GenerateClientRequestId = true; + ApplicationGateways = new ApplicationGatewaysOperations(this); + ExpressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationsOperations(this); + ExpressRouteCircuitPeerings = new ExpressRouteCircuitPeeringsOperations(this); + ExpressRouteCircuits = new ExpressRouteCircuitsOperations(this); + ExpressRouteServiceProviders = new ExpressRouteServiceProvidersOperations(this); + LoadBalancers = new LoadBalancersOperations(this); + LocalNetworkGateways = new LocalNetworkGatewaysOperations(this); + NetworkInterfaces = new NetworkInterfacesOperations(this); + NetworkSecurityGroups = new NetworkSecurityGroupsOperations(this); + PublicIPAddresses = new PublicIPAddressesOperations(this); + RouteTables = new RouteTablesOperations(this); + Routes = new RoutesOperations(this); + SecurityRules = new SecurityRulesOperations(this); + Subnets = new SubnetsOperations(this); + VirtualNetworkPeerings = new VirtualNetworkPeeringsOperations(this); + Usages = new UsagesOperations(this); + VirtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionsOperations(this); + VirtualNetworkGateways = new VirtualNetworkGatewaysOperations(this); + VirtualNetworks = new VirtualNetworksOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2016-09-01"; + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, @@ -398,29 +408,29 @@ private void Initialize() DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new System.Collections.Generic.List { - new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + new Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + SerializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new System.Collections.Generic.List { - new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + new Iso8601TimeSpanConverter() } }; CustomInitialize(); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); - } + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } /// /// Checks whether a domain name in the cloudapp.net zone is available for use. /// @@ -437,79 +447,82 @@ private void Initialize() /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> CheckDnsNameAvailabilityWithHttpMessagesAsync(string location, string domainNameLabel = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> CheckDnsNameAvailabilityWithHttpMessagesAsync(string location, string domainNameLabel = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (location == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); + throw new ValidationException(ValidationRules.CannotBeNull, "location"); } - if (this.ApiVersion == null) + if (ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); } - if (this.SubscriptionId == null) + if (SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("domainNameLabel", domainNameLabel); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckDnsNameAvailability", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CheckDnsNameAvailability", tracingParameters); } // Construct URL - var _baseUrl = this.BaseUri.AbsoluteUri; + var _baseUrl = BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + List _queryParameters = new List(); if (domainNameLabel != null) { _queryParameters.Add(string.Format("domainNameLabel={0}", System.Uri.EscapeDataString(domainNameLabel))); } - if (this.ApiVersion != null) + if (ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.ApiVersion))); + _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 - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.AcceptLanguage != null) + if (AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); } if (customHeaders != null) { @@ -526,35 +539,35 @@ private void Initialize() // Serialize Request string _requestContent = null; // Set Credentials - if (this.Credentials != null) + if (Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -562,15 +575,15 @@ private void Initialize() { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -580,7 +593,7 @@ private void Initialize() throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -593,7 +606,7 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -602,15 +615,16 @@ private void Initialize() { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClientExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClientExtensions.cs index 10454e22c62f5..081b5898ca456 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClientExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClientExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for NetworkManagementClient. @@ -32,7 +36,7 @@ public static partial class NetworkManagementClientExtensions /// public static DnsNameAvailabilityResult CheckDnsNameAvailability(this INetworkManagementClient operations, string location, string domainNameLabel = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkManagementClient)s).CheckDnsNameAvailabilityAsync(location, domainNameLabel), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkManagementClient)s).CheckDnsNameAvailabilityAsync(location, domainNameLabel), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -51,7 +55,7 @@ public static partial class NetworkManagementClientExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CheckDnsNameAvailabilityAsync(this INetworkManagementClient operations, string location, string domainNameLabel = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CheckDnsNameAvailabilityAsync(this INetworkManagementClient operations, string location, string domainNameLabel = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CheckDnsNameAvailabilityWithHttpMessagesAsync(location, domainNameLabel, null, cancellationToken).ConfigureAwait(false)) { @@ -61,3 +65,4 @@ public static partial class NetworkManagementClientExtensions } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperations.cs index 4a6aa71c1af49..0cf2029597a50 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// NetworkSecurityGroupsOperations operations. /// - internal partial class NetworkSecurityGroupsOperations : Microsoft.Rest.IServiceOperations, INetworkSecurityGroupsOperations + internal partial class NetworkSecurityGroupsOperations : IServiceOperations, INetworkSecurityGroupsOperations { /// /// Initializes a new instance of the NetworkSecurityGroupsOperations class. @@ -29,11 +38,11 @@ internal partial class NetworkSecurityGroupsOperations : Microsoft.Rest.IService /// internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -56,16 +65,16 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, networkSecurityGroupName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// Deletes the specified network security group. + /// Gets the specified network security group. /// /// /// The name of the resource group. @@ -73,83 +82,97 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The name of the network security group. /// + /// + /// Expands referenced resources. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (networkSecurityGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -166,43 +189,51 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + 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; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,22 +243,41 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets the specified network security group. + /// Creates or updates a network security group in the specified resource + /// group. /// /// /// The name of the resource group. @@ -235,94 +285,100 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The name of the network security group. /// - /// - /// Expands referenced resources. + /// + /// Parameters supplied to the create or update network security group + /// operation. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, networkSecurityGroupName, parameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all network security groups in a subscription. + /// + /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkSecurityGroupName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); - tracingParameters.Add("expand", expand); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); - } - if (expand != null) + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -339,35 +395,35 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -375,15 +431,15 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -393,7 +449,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -406,7 +462,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -415,145 +471,99 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Creates or updates a network security group in the specified resource - /// group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to the create or update network security group - /// operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, networkSecurityGroupName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// Creates or updates a network security group in the specified resource - /// group. + /// Gets all network security groups in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to the create or update network security group - /// operation. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkSecurityGroupName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -569,42 +579,36 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -612,15 +616,15 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -630,7 +634,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -638,30 +642,12 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -670,87 +656,105 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all network security groups in a subscription. + /// Deletes the specified network security group. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when 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 System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.ApiVersion == null) + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkSecurityGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); } - if (this.Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -767,51 +771,43 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 202 && (int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (Newtonsoft.Json.JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -821,118 +817,122 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all network security groups in a resource group. + /// Creates or updates a network security group in the specified resource + /// group. /// /// /// The name of the resource group. /// + /// + /// The name of the network security group. + /// + /// + /// Parameters supplied to the create or update network security group + /// operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (networkSecurityGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + } + if (parameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (this.Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -948,36 +948,42 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 201 && (int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -985,15 +991,15 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1003,7 +1009,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1011,12 +1017,30 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1025,12 +1049,12 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1047,60 +1071,63 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1117,35 +1144,35 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1153,15 +1180,15 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1171,7 +1198,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1184,7 +1211,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1193,12 +1220,12 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1215,60 +1242,63 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1285,35 +1315,35 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1321,15 +1351,15 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1339,7 +1369,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1352,7 +1382,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1361,15 +1391,16 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperationsExtensions.cs index 0dc9b17b60672..448b613f38c6e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for NetworkSecurityGroupsOperations. @@ -31,7 +35,7 @@ public static partial class NetworkSecurityGroupsOperationsExtensions /// public static void Delete(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).DeleteAsync(resourceGroupName, networkSecurityGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).DeleteAsync(resourceGroupName, networkSecurityGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -49,48 +53,11 @@ public static void Delete(this INetworkSecurityGroupsOperations operations, stri /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, CancellationToken cancellationToken = default(CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false); } - /// - /// Deletes the specified network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - public static void BeginDelete(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName) - { - System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).BeginDeleteAsync(resourceGroupName, networkSecurityGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified network security group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false); - } - /// /// Gets the specified network security group. /// @@ -108,7 +75,7 @@ public static void BeginDelete(this INetworkSecurityGroupsOperations operations, /// public static NetworkSecurityGroup Get(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, string expand = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).GetAsync(resourceGroupName, networkSecurityGroupName, expand), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).GetAsync(resourceGroupName, networkSecurityGroupName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -129,7 +96,7 @@ public static void BeginDelete(this INetworkSecurityGroupsOperations operations, /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, expand, null, cancellationToken).ConfigureAwait(false)) { @@ -156,7 +123,7 @@ public static void BeginDelete(this INetworkSecurityGroupsOperations operations, /// public static NetworkSecurityGroup CreateOrUpdate(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).CreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).CreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -179,7 +146,7 @@ public static NetworkSecurityGroup CreateOrUpdate(this INetworkSecurityGroupsOpe /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -188,30 +155,35 @@ public static NetworkSecurityGroup CreateOrUpdate(this INetworkSecurityGroupsOpe } /// - /// Creates or updates a network security group in the specified resource - /// group. + /// Gets all network security groups in a subscription. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. + public static IPage ListAll(this INetworkSecurityGroupsOperations operations) + { + return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Gets all network security groups in a subscription. + /// + /// + /// The operations group for this extension method. /// - /// - /// Parameters supplied to the create or update network security group - /// operation. + /// + /// The cancellation token. /// - public static NetworkSecurityGroup BeginCreateOrUpdate(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters) + public static async Task> ListAllAsync(this INetworkSecurityGroupsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Creates or updates a network security group in the specified resource - /// group. + /// Gets all network security groups in a resource group. /// /// /// The operations group for this extension method. @@ -219,54 +191,71 @@ public static NetworkSecurityGroup BeginCreateOrUpdate(this INetworkSecurityGrou /// /// The name of the resource group. /// - /// - /// The name of the network security group. + public static IPage List(this INetworkSecurityGroupsOperations operations, string resourceGroupName) + { + return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Gets all network security groups in a resource group. + /// + /// + /// The operations group for this extension method. /// - /// - /// Parameters supplied to the create or update network security group - /// operation. + /// + /// The name of the resource group. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets all network security groups in a subscription. + /// Deletes the specified network security group. /// /// /// The operations group for this extension method. /// - public static Microsoft.Rest.Azure.IPage ListAll(this INetworkSecurityGroupsOperations operations) + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + public static void BeginDelete(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).ListAllAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).BeginDeleteAsync(resourceGroupName, networkSecurityGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all network security groups in a subscription. + /// Deletes the specified network security group. /// /// /// The operations group for this extension method. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// /// /// The cancellation token. /// - public static async Task> ListAllAsync(this INetworkSecurityGroupsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginDeleteAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false); } /// - /// Gets all network security groups in a resource group. + /// Creates or updates a network security group in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -274,13 +263,21 @@ public static Microsoft.Rest.Azure.IPage ListAll(this INet /// /// The name of the resource group. /// - public static Microsoft.Rest.Azure.IPage List(this INetworkSecurityGroupsOperations operations, string resourceGroupName) + /// + /// The name of the network security group. + /// + /// + /// Parameters supplied to the create or update network security group + /// operation. + /// + public static NetworkSecurityGroup BeginCreateOrUpdate(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all network security groups in a resource group. + /// Creates or updates a network security group in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -288,12 +285,19 @@ public static Microsoft.Rest.Azure.IPage List(this INetwor /// /// The name of the resource group. /// + /// + /// The name of the network security group. + /// + /// + /// Parameters supplied to the create or update network security group + /// operation. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -308,9 +312,9 @@ public static Microsoft.Rest.Azure.IPage List(this INetwor /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListAllNext(this INetworkSecurityGroupsOperations operations, string nextPageLink) + public static IPage ListAllNext(this INetworkSecurityGroupsOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).ListAllNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).ListAllNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -325,7 +329,7 @@ public static Microsoft.Rest.Azure.IPage ListAllNext(this /// /// The cancellation token. /// - public static async Task> ListAllNextAsync(this INetworkSecurityGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAllNextAsync(this INetworkSecurityGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -342,9 +346,9 @@ public static Microsoft.Rest.Azure.IPage ListAllNext(this /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this INetworkSecurityGroupsOperations operations, string nextPageLink) + public static IPage ListNext(this INetworkSecurityGroupsOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -359,7 +363,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this INe /// /// The cancellation token. /// - public static async Task> ListNextAsync(this INetworkSecurityGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this INetworkSecurityGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -369,3 +373,4 @@ public static Microsoft.Rest.Azure.IPage ListNext(this INe } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperations.cs index f76a6bac74c34..26f7750ea03c8 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// PublicIPAddressesOperations operations. /// - internal partial class PublicIPAddressesOperations : Microsoft.Rest.IServiceOperations, IPublicIPAddressesOperations + internal partial class PublicIPAddressesOperations : IServiceOperations, IPublicIPAddressesOperations { /// /// Initializes a new instance of the PublicIPAddressesOperations class. @@ -29,11 +38,11 @@ internal partial class PublicIPAddressesOperations : Microsoft.Rest.IServiceOper /// internal PublicIPAddressesOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -56,16 +65,16 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, publicIpAddressName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// Deletes the specified public IP address. + /// Gets the specified public IP address in a specified resource group. /// /// /// The name of the resource group. @@ -73,83 +82,97 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The name of the subnet. /// + /// + /// Expands referenced resources. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (publicIpAddressName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicIpAddressName"); + throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("publicIpAddressName", publicIpAddressName); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -166,43 +189,51 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + 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; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,117 +243,140 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets the specified public IP address in a specified resource group. + /// Creates or updates a static or dynamic public IP address. /// /// /// The name of the resource group. /// /// - /// The name of the subnet. + /// The name of the public IP address. /// - /// - /// Expands referenced resources. + /// + /// Parameters supplied to the create or update public IP address operation. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, publicIpAddressName, parameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all the public IP addresses in a subscription. + /// + /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (publicIpAddressName == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicIpAddressName"); - } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("publicIpAddressName", publicIpAddressName); - tracingParameters.Add("expand", expand); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); - } - if (expand != null) + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -339,35 +393,35 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -375,15 +429,15 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -393,7 +447,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -406,7 +460,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -415,141 +469,99 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Creates or updates a static or dynamic public IP address. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - /// - /// Parameters supplied to the create or update public IP address operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, publicIpAddressName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// Creates or updates a static or dynamic public IP address. + /// Gets all public IP addresses in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the public IP address. - /// - /// - /// Parameters supplied to the create or update public IP address operation. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (publicIpAddressName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicIpAddressName"); - } - if (parameters == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.ApiVersion == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("publicIpAddressName", publicIpAddressName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -565,42 +577,36 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -608,15 +614,15 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -626,7 +632,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -634,30 +640,12 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -666,87 +654,105 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all the public IP addresses in a subscription. + /// Deletes the specified public IP address. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the subnet. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when 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 System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.ApiVersion == null) + if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.SubscriptionId == null) + if (publicIpAddressName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); + } + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("publicIpAddressName", publicIpAddressName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -763,51 +769,43 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (Newtonsoft.Json.JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -817,118 +815,120 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all public IP addresses in a resource group. + /// Creates or updates a static or dynamic public IP address. /// /// /// The name of the resource group. /// + /// + /// The name of the public IP address. + /// + /// + /// Parameters supplied to the create or update public IP address operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (publicIpAddressName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); } - if (this.Client.SubscriptionId == null) + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("publicIpAddressName", publicIpAddressName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -944,36 +944,42 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 201 && (int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -981,15 +987,15 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -999,7 +1005,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1007,12 +1013,30 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1021,12 +1045,12 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1043,60 +1067,63 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1113,35 +1140,35 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1149,15 +1176,15 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1167,7 +1194,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1180,7 +1207,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1189,12 +1216,12 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1211,60 +1238,63 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1281,35 +1311,35 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1317,15 +1347,15 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1335,7 +1365,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1348,7 +1378,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1357,15 +1387,16 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperationsExtensions.cs index ae604604140f1..0006826483336 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for PublicIPAddressesOperations. @@ -31,7 +35,7 @@ public static partial class PublicIPAddressesOperationsExtensions /// public static void Delete(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).DeleteAsync(resourceGroupName, publicIpAddressName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).DeleteAsync(resourceGroupName, publicIpAddressName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -49,48 +53,11 @@ public static void Delete(this IPublicIPAddressesOperations operations, string r /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, CancellationToken cancellationToken = default(CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, null, cancellationToken).ConfigureAwait(false); } - /// - /// Deletes the specified public IP address. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the subnet. - /// - public static void BeginDelete(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName) - { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).BeginDeleteAsync(resourceGroupName, publicIpAddressName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified public IP address. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the subnet. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, null, cancellationToken).ConfigureAwait(false); - } - /// /// Gets the specified public IP address in a specified resource group. /// @@ -108,7 +75,7 @@ public static void BeginDelete(this IPublicIPAddressesOperations operations, str /// public static PublicIPAddress Get(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, string expand = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).GetAsync(resourceGroupName, publicIpAddressName, expand), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).GetAsync(resourceGroupName, publicIpAddressName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -129,7 +96,7 @@ public static void BeginDelete(this IPublicIPAddressesOperations operations, str /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, expand, null, cancellationToken).ConfigureAwait(false)) { @@ -154,7 +121,7 @@ public static void BeginDelete(this IPublicIPAddressesOperations operations, str /// public static PublicIPAddress CreateOrUpdate(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).CreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).CreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -175,7 +142,7 @@ public static PublicIPAddress CreateOrUpdate(this IPublicIPAddressesOperations o /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -184,27 +151,35 @@ public static PublicIPAddress CreateOrUpdate(this IPublicIPAddressesOperations o } /// - /// Creates or updates a static or dynamic public IP address. + /// Gets all the public IP addresses in a subscription. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. + public static IPage ListAll(this IPublicIPAddressesOperations operations) + { + return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Gets all the public IP addresses in a subscription. + /// + /// + /// The operations group for this extension method. /// - /// - /// Parameters supplied to the create or update public IP address operation. + /// + /// The cancellation token. /// - public static PublicIPAddress BeginCreateOrUpdate(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters) + public static async Task> ListAllAsync(this IPublicIPAddressesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Creates or updates a static or dynamic public IP address. + /// Gets all public IP addresses in a resource group. /// /// /// The operations group for this extension method. @@ -212,53 +187,70 @@ public static PublicIPAddress BeginCreateOrUpdate(this IPublicIPAddressesOperati /// /// The name of the resource group. /// - /// - /// The name of the public IP address. + public static IPage List(this IPublicIPAddressesOperations operations, string resourceGroupName) + { + return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Gets all public IP addresses in a resource group. + /// + /// + /// The operations group for this extension method. /// - /// - /// Parameters supplied to the create or update public IP address operation. + /// + /// The name of the resource group. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets all the public IP addresses in a subscription. + /// Deletes the specified public IP address. /// /// /// The operations group for this extension method. /// - public static Microsoft.Rest.Azure.IPage ListAll(this IPublicIPAddressesOperations operations) + /// + /// The name of the resource group. + /// + /// + /// The name of the subnet. + /// + public static void BeginDelete(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).ListAllAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).BeginDeleteAsync(resourceGroupName, publicIpAddressName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all the public IP addresses in a subscription. + /// Deletes the specified public IP address. /// /// /// The operations group for this extension method. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the subnet. + /// /// /// The cancellation token. /// - public static async Task> ListAllAsync(this IPublicIPAddressesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginDeleteAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, null, cancellationToken).ConfigureAwait(false); } /// - /// Gets all public IP addresses in a resource group. + /// Creates or updates a static or dynamic public IP address. /// /// /// The operations group for this extension method. @@ -266,13 +258,19 @@ public static Microsoft.Rest.Azure.IPage ListAll(this IPublicIP /// /// The name of the resource group. /// - public static Microsoft.Rest.Azure.IPage List(this IPublicIPAddressesOperations operations, string resourceGroupName) + /// + /// The name of the public IP address. + /// + /// + /// Parameters supplied to the create or update public IP address operation. + /// + public static PublicIPAddress BeginCreateOrUpdate(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all public IP addresses in a resource group. + /// Creates or updates a static or dynamic public IP address. /// /// /// The operations group for this extension method. @@ -280,12 +278,18 @@ public static Microsoft.Rest.Azure.IPage List(this IPublicIPAdd /// /// The name of the resource group. /// + /// + /// The name of the public IP address. + /// + /// + /// Parameters supplied to the create or update public IP address operation. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -300,9 +304,9 @@ public static Microsoft.Rest.Azure.IPage List(this IPublicIPAdd /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListAllNext(this IPublicIPAddressesOperations operations, string nextPageLink) + public static IPage ListAllNext(this IPublicIPAddressesOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).ListAllNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).ListAllNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -317,7 +321,7 @@ public static Microsoft.Rest.Azure.IPage ListAllNext(this IPubl /// /// The cancellation token. /// - public static async Task> ListAllNextAsync(this IPublicIPAddressesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAllNextAsync(this IPublicIPAddressesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -334,9 +338,9 @@ public static Microsoft.Rest.Azure.IPage ListAllNext(this IPubl /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this IPublicIPAddressesOperations operations, string nextPageLink) + public static IPage ListNext(this IPublicIPAddressesOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -351,7 +355,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IPublicI /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IPublicIPAddressesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IPublicIPAddressesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -361,3 +365,4 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IPublicI } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperations.cs index a6c410530044c..dd3f893669109 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// RouteTablesOperations operations. /// - internal partial class RouteTablesOperations : Microsoft.Rest.IServiceOperations, IRouteTablesOperations + internal partial class RouteTablesOperations : IServiceOperations, IRouteTablesOperations { /// /// Initializes a new instance of the RouteTablesOperations class. @@ -29,11 +38,11 @@ internal partial class RouteTablesOperations : Microsoft.Rest.IServiceOperations /// internal RouteTablesOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -56,16 +65,16 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, routeTableName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// Deletes the specified route table. + /// Gets the specified route table. /// /// /// The name of the resource group. @@ -73,83 +82,97 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The name of the route table. /// + /// + /// Expands referenced resources. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (routeTableName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); + throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -166,43 +189,51 @@ internal RouteTablesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + 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; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,22 +243,40 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets the specified route table. + /// Create or updates a route table in a specified resource group. /// /// /// The name of the resource group. @@ -235,8 +284,30 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The name of the route table. /// - /// - /// Expands referenced resources. + /// + /// Parameters supplied to the create or update route table operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, routeTableName, parameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all route tables in a resource group. + /// + /// + /// The name of the resource group. /// /// /// Headers that will be added to request. @@ -244,85 +315,77 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (routeTableName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("routeTableName", routeTableName); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); - } - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -339,35 +402,35 @@ internal RouteTablesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -375,15 +438,15 @@ internal RouteTablesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -393,7 +456,7 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -406,7 +469,7 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -415,141 +478,90 @@ internal RouteTablesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Create or updates a route table in a specified resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// Parameters supplied to the create or update route table operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, routeTableName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// Create or updates a route table in a specified resource group. + /// Gets all route tables in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// Parameters supplied to the create or update route table operation. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (routeTableName == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); - } - if (parameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); - } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("routeTableName", routeTableName); - tracingParameters.Add("parameters", parameters); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -565,42 +577,36 @@ internal RouteTablesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -608,15 +614,15 @@ internal RouteTablesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -626,7 +632,7 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -639,7 +645,7 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -648,114 +654,105 @@ internal RouteTablesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all route tables in a resource group. + /// Deletes the specified route table. /// /// /// The name of the resource group. /// + /// + /// The name of the route table. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (routeTableName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } - if (this.Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -772,51 +769,43 @@ internal RouteTablesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (Newtonsoft.Json.JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -826,109 +815,120 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all route tables in a subscription. + /// Create or updates a route table in a specified resource group. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// Parameters supplied to the create or update route table operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.ApiVersion == null) + if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.SubscriptionId == null) + if (routeTableName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("routeTableName", routeTableName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -944,36 +944,42 @@ internal RouteTablesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -981,15 +987,15 @@ internal RouteTablesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -999,7 +1005,7 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1012,7 +1018,25 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1021,12 +1045,12 @@ internal RouteTablesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1043,60 +1067,63 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1113,35 +1140,35 @@ internal RouteTablesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1149,15 +1176,15 @@ internal RouteTablesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1167,7 +1194,7 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1180,7 +1207,7 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1189,12 +1216,12 @@ internal RouteTablesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1211,60 +1238,63 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1281,35 +1311,35 @@ internal RouteTablesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1317,15 +1347,15 @@ internal RouteTablesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1335,7 +1365,7 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1348,7 +1378,7 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1357,15 +1387,16 @@ internal RouteTablesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperationsExtensions.cs index 5fd9cffa20ef5..701e924223815 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for RouteTablesOperations. @@ -31,7 +35,7 @@ public static partial class RouteTablesOperationsExtensions /// public static void Delete(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IRouteTablesOperations)s).DeleteAsync(resourceGroupName, routeTableName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IRouteTablesOperations)s).DeleteAsync(resourceGroupName, routeTableName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -49,48 +53,11 @@ public static void Delete(this IRouteTablesOperations operations, string resourc /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, null, cancellationToken).ConfigureAwait(false); } - /// - /// Deletes the specified route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - public static void BeginDelete(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName) - { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IRouteTablesOperations)s).BeginDeleteAsync(resourceGroupName, routeTableName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified route table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, null, cancellationToken).ConfigureAwait(false); - } - /// /// Gets the specified route table. /// @@ -108,7 +75,7 @@ public static void BeginDelete(this IRouteTablesOperations operations, string re /// public static RouteTable Get(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, string expand = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRouteTablesOperations)s).GetAsync(resourceGroupName, routeTableName, expand), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).GetAsync(resourceGroupName, routeTableName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -129,7 +96,7 @@ public static void BeginDelete(this IRouteTablesOperations operations, string re /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, routeTableName, expand, null, cancellationToken).ConfigureAwait(false)) { @@ -154,7 +121,7 @@ public static void BeginDelete(this IRouteTablesOperations operations, string re /// public static RouteTable CreateOrUpdate(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRouteTablesOperations)s).CreateOrUpdateAsync(resourceGroupName, routeTableName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).CreateOrUpdateAsync(resourceGroupName, routeTableName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -175,7 +142,7 @@ public static RouteTable CreateOrUpdate(this IRouteTablesOperations operations, /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -184,7 +151,7 @@ public static RouteTable CreateOrUpdate(this IRouteTablesOperations operations, } /// - /// Create or updates a route table in a specified resource group. + /// Gets all route tables in a resource group. /// /// /// The operations group for this extension method. @@ -192,19 +159,13 @@ public static RouteTable CreateOrUpdate(this IRouteTablesOperations operations, /// /// The name of the resource group. /// - /// - /// The name of the route table. - /// - /// - /// Parameters supplied to the create or update route table operation. - /// - public static RouteTable BeginCreateOrUpdate(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters) + public static IPage List(this IRouteTablesOperations operations, string resourceGroupName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRouteTablesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, routeTableName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Create or updates a route table in a specified resource group. + /// Gets all route tables in a resource group. /// /// /// The operations group for this extension method. @@ -212,25 +173,47 @@ public static RouteTable BeginCreateOrUpdate(this IRouteTablesOperations operati /// /// The name of the resource group. /// - /// - /// The name of the route table. + /// + /// The cancellation token. /// - /// - /// Parameters supplied to the create or update route table operation. + public static async Task> ListAsync(this IRouteTablesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all route tables in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage ListAll(this IRouteTablesOperations operations) + { + return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Gets all route tables in a subscription. + /// + /// + /// The operations group for this extension method. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAllAsync(this IRouteTablesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets all route tables in a resource group. + /// Deletes the specified route table. /// /// /// The operations group for this extension method. @@ -238,13 +221,16 @@ public static RouteTable BeginCreateOrUpdate(this IRouteTablesOperations operati /// /// The name of the resource group. /// - public static Microsoft.Rest.Azure.IPage List(this IRouteTablesOperations operations, string resourceGroupName) + /// + /// The name of the route table. + /// + public static void BeginDelete(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRouteTablesOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IRouteTablesOperations)s).BeginDeleteAsync(resourceGroupName, routeTableName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all route tables in a resource group. + /// Deletes the specified route table. /// /// /// The operations group for this extension method. @@ -252,40 +238,58 @@ public static Microsoft.Rest.Azure.IPage List(this IRouteTablesOpera /// /// The name of the resource group. /// + /// + /// The name of the route table. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IRouteTablesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginDeleteAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, null, cancellationToken).ConfigureAwait(false); } /// - /// Gets all route tables in a subscription. + /// Create or updates a route table in a specified resource group. /// /// /// The operations group for this extension method. /// - public static Microsoft.Rest.Azure.IPage ListAll(this IRouteTablesOperations operations) + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// Parameters supplied to the create or update route table operation. + /// + public static RouteTable BeginCreateOrUpdate(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRouteTablesOperations)s).ListAllAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, routeTableName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all route tables in a subscription. + /// Create or updates a route table in a specified resource group. /// /// /// The operations group for this extension method. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// Parameters supplied to the create or update route table operation. + /// /// /// The cancellation token. /// - public static async Task> ListAllAsync(this IRouteTablesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -300,9 +304,9 @@ public static Microsoft.Rest.Azure.IPage ListAll(this IRouteTablesOp /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this IRouteTablesOperations operations, string nextPageLink) + public static IPage ListNext(this IRouteTablesOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRouteTablesOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -317,7 +321,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IRouteTablesO /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IRouteTablesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IRouteTablesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -334,9 +338,9 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IRouteTablesO /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListAllNext(this IRouteTablesOperations operations, string nextPageLink) + public static IPage ListAllNext(this IRouteTablesOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRouteTablesOperations)s).ListAllNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).ListAllNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -351,7 +355,7 @@ public static Microsoft.Rest.Azure.IPage ListAllNext(this IRouteTabl /// /// The cancellation token. /// - public static async Task> ListAllNextAsync(this IRouteTablesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAllNextAsync(this IRouteTablesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -361,3 +365,4 @@ public static Microsoft.Rest.Azure.IPage ListAllNext(this IRouteTabl } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperations.cs index 2b0b6a170c8b7..19689b77f4ff8 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// RoutesOperations operations. /// - internal partial class RoutesOperations : Microsoft.Rest.IServiceOperations, IRoutesOperations + internal partial class RoutesOperations : IServiceOperations, IRoutesOperations { /// /// Initializes a new instance of the RoutesOperations class. @@ -29,11 +38,11 @@ internal partial class RoutesOperations : Microsoft.Rest.IServiceOperations internal RoutesOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -59,16 +68,16 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, routeTableName, routeName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// Deletes the specified route from a route table. + /// Gets the specified route from a route table. /// /// /// The name of the resource group. @@ -85,83 +94,89 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (routeTableName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); + throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } if (routeName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeName"); + throw new ValidationException(ValidationRules.CannotBeNull, "routeName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("routeName", routeName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); _url = _url.Replace("{routeName}", System.Uri.EscapeDataString(routeName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -178,43 +193,51 @@ internal RoutesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + 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; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -224,22 +247,40 @@ internal RoutesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets the specified route from a route table. + /// Creates or updates a route in the specified route table. /// /// /// The name of the resource group. @@ -250,92 +291,117 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The name of the route. /// + /// + /// Parameters supplied to the create or update route operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, routeTableName, routeName, routeParameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all routes in a route table. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (routeTableName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); + throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } - if (routeName == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.ApiVersion == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); - tracingParameters.Add("routeName", routeName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{routeName}", System.Uri.EscapeDataString(routeName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -352,35 +418,35 @@ internal RoutesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -388,15 +454,15 @@ internal RoutesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -406,7 +472,7 @@ internal RoutesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -419,7 +485,7 @@ internal RoutesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -428,49 +494,18 @@ internal RoutesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Creates or updates a route in the specified route table. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// The name of the route. - /// - /// - /// Parameters supplied to the create or update route operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, routeTableName, routeName, routeParameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// Creates or updates a route in the specified route table. + /// Deletes the specified route from a route table. /// /// /// The name of the resource group. @@ -481,104 +516,92 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The name of the route. /// - /// - /// Parameters supplied to the create or update route operation. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response + /// + /// Thrown when a required parameter is null /// - /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (routeTableName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); + throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } if (routeName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeName"); - } - if (routeParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeParameters"); - } - if (routeParameters != null) - { - routeParameters.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "routeName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("routeName", routeName); - tracingParameters.Add("routeParameters", routeParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); _url = _url.Replace("{routeName}", System.Uri.EscapeDataString(routeName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -594,58 +617,44 @@ internal RoutesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(routeParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(routeParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 202 && (int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (Newtonsoft.Json.JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -655,58 +664,22 @@ internal RoutesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all routes in a route table. + /// Creates or updates a route in the specified route table. /// /// /// The name of the resource group. @@ -714,86 +687,110 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The name of the route table. /// + /// + /// The name of the route. + /// + /// + /// Parameters supplied to the create or update route operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string routeTableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (routeTableName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "routeTableName"); + throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } - if (this.Client.ApiVersion == null) + if (routeName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "routeName"); } - if (this.Client.SubscriptionId == null) + if (routeParameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "routeParameters"); + } + if (routeParameters != null) + { + routeParameters.Validate(); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); + tracingParameters.Add("routeName", routeName); + tracingParameters.Add("routeParameters", routeParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{routeName}", System.Uri.EscapeDataString(routeName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -809,36 +806,42 @@ internal RoutesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(routeParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(routeParameters, Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -846,15 +849,15 @@ internal RoutesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -864,7 +867,7 @@ internal RoutesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -877,7 +880,25 @@ internal RoutesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -886,12 +907,12 @@ internal RoutesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -908,60 +929,63 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -978,35 +1002,35 @@ internal RoutesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1014,15 +1038,15 @@ internal RoutesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1032,7 +1056,7 @@ internal RoutesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1045,7 +1069,7 @@ internal RoutesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1054,15 +1078,16 @@ internal RoutesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperationsExtensions.cs index 5a32eeffb5b49..afa230813a413 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for RoutesOperations. @@ -34,7 +38,7 @@ public static partial class RoutesOperationsExtensions /// public static void Delete(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IRoutesOperations)s).DeleteAsync(resourceGroupName, routeTableName, routeName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IRoutesOperations)s).DeleteAsync(resourceGroupName, routeTableName, routeName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -55,13 +59,13 @@ public static void Delete(this IRoutesOperations operations, string resourceGrou /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, CancellationToken cancellationToken = default(CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, null, cancellationToken).ConfigureAwait(false); } /// - /// Deletes the specified route from a route table. + /// Gets the specified route from a route table. /// /// /// The operations group for this extension method. @@ -75,13 +79,13 @@ public static void Delete(this IRoutesOperations operations, string resourceGrou /// /// The name of the route. /// - public static void BeginDelete(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName) + public static Route Get(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IRoutesOperations)s).BeginDeleteAsync(resourceGroupName, routeTableName, routeName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IRoutesOperations)s).GetAsync(resourceGroupName, routeTableName, routeName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Deletes the specified route from a route table. + /// Gets the specified route from a route table. /// /// /// The operations group for this extension method. @@ -98,13 +102,16 @@ public static void BeginDelete(this IRoutesOperations operations, string resourc /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Gets the specified route from a route table. + /// Creates or updates a route in the specified route table. /// /// /// The operations group for this extension method. @@ -118,13 +125,16 @@ public static void BeginDelete(this IRoutesOperations operations, string resourc /// /// The name of the route. /// - public static Route Get(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName) + /// + /// Parameters supplied to the create or update route operation. + /// + public static Route CreateOrUpdate(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRoutesOperations)s).GetAsync(resourceGroupName, routeTableName, routeName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IRoutesOperations)s).CreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets the specified route from a route table. + /// Creates or updates a route in the specified route table. /// /// /// The operations group for this extension method. @@ -138,19 +148,22 @@ public static Route Get(this IRoutesOperations operations, string resourceGroupN /// /// The name of the route. /// + /// + /// Parameters supplied to the create or update route operation. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, routeParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates a route in the specified route table. + /// Gets all routes in a route table. /// /// /// The operations group for this extension method. @@ -161,19 +174,13 @@ public static Route Get(this IRoutesOperations operations, string resourceGroupN /// /// The name of the route table. /// - /// - /// The name of the route. - /// - /// - /// Parameters supplied to the create or update route operation. - /// - public static Route CreateOrUpdate(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters) + public static IPage List(this IRoutesOperations operations, string resourceGroupName, string routeTableName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRoutesOperations)s).CreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IRoutesOperations)s).ListAsync(resourceGroupName, routeTableName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Creates or updates a route in the specified route table. + /// Gets all routes in a route table. /// /// /// The operations group for this extension method. @@ -184,25 +191,19 @@ public static Route CreateOrUpdate(this IRoutesOperations operations, string res /// /// The name of the route table. /// - /// - /// The name of the route. - /// - /// - /// Parameters supplied to the create or update route operation. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, routeParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, routeTableName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates a route in the specified route table. + /// Deletes the specified route from a route table. /// /// /// The operations group for this extension method. @@ -216,16 +217,13 @@ public static Route CreateOrUpdate(this IRoutesOperations operations, string res /// /// The name of the route. /// - /// - /// Parameters supplied to the create or update route operation. - /// - public static Route BeginCreateOrUpdate(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters) + public static void BeginDelete(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRoutesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IRoutesOperations)s).BeginDeleteAsync(resourceGroupName, routeTableName, routeName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Creates or updates a route in the specified route table. + /// Deletes the specified route from a route table. /// /// /// The operations group for this extension method. @@ -239,22 +237,16 @@ public static Route BeginCreateOrUpdate(this IRoutesOperations operations, strin /// /// The name of the route. /// - /// - /// Parameters supplied to the create or update route operation. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginDeleteAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, routeParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, null, cancellationToken).ConfigureAwait(false); } /// - /// Gets all routes in a route table. + /// Creates or updates a route in the specified route table. /// /// /// The operations group for this extension method. @@ -265,13 +257,19 @@ public static Route BeginCreateOrUpdate(this IRoutesOperations operations, strin /// /// The name of the route table. /// - public static Microsoft.Rest.Azure.IPage List(this IRoutesOperations operations, string resourceGroupName, string routeTableName) + /// + /// The name of the route. + /// + /// + /// Parameters supplied to the create or update route operation. + /// + public static Route BeginCreateOrUpdate(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRoutesOperations)s).ListAsync(resourceGroupName, routeTableName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IRoutesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all routes in a route table. + /// Creates or updates a route in the specified route table. /// /// /// The operations group for this extension method. @@ -282,12 +280,18 @@ public static Microsoft.Rest.Azure.IPage List(this IRoutesOperations oper /// /// The name of the route table. /// + /// + /// The name of the route. + /// + /// + /// Parameters supplied to the create or update route operation. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, routeTableName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, routeParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -302,9 +306,9 @@ public static Microsoft.Rest.Azure.IPage List(this IRoutesOperations oper /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this IRoutesOperations operations, string nextPageLink) + public static IPage ListNext(this IRoutesOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IRoutesOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IRoutesOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -319,7 +323,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IRoutesOperations /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IRoutesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IRoutesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -329,3 +333,4 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IRoutesOperations } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperations.cs index 838c35f7f8df0..436a5c1e0aee0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// SecurityRulesOperations operations. /// - internal partial class SecurityRulesOperations : Microsoft.Rest.IServiceOperations, ISecurityRulesOperations + internal partial class SecurityRulesOperations : IServiceOperations, ISecurityRulesOperations { /// /// Initializes a new instance of the SecurityRulesOperations class. @@ -29,11 +38,11 @@ internal partial class SecurityRulesOperations : Microsoft.Rest.IServiceOperatio /// internal SecurityRulesOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -59,16 +68,16 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, networkSecurityGroupName, securityRuleName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// Deletes the specified network security rule. + /// Get the specified network security rule. /// /// /// The name of the resource group. @@ -85,83 +94,89 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (networkSecurityGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); } if (securityRuleName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "securityRuleName"); + throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("securityRuleName", securityRuleName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); _url = _url.Replace("{securityRuleName}", System.Uri.EscapeDataString(securityRuleName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -178,43 +193,51 @@ internal SecurityRulesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + 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; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -224,22 +247,40 @@ internal SecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Get the specified network security rule. + /// Creates or updates a security rule in the specified network security group. /// /// /// The name of the resource group. @@ -250,92 +291,118 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The name of the security rule. /// + /// + /// Parameters supplied to the create or update network security rule + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all security rules in a network security group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (networkSecurityGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); } - if (securityRuleName == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "securityRuleName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.ApiVersion == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); - tracingParameters.Add("securityRuleName", securityRuleName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{securityRuleName}", System.Uri.EscapeDataString(securityRuleName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -352,35 +419,35 @@ internal SecurityRulesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -388,15 +455,15 @@ internal SecurityRulesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -406,7 +473,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -419,7 +486,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -428,50 +495,18 @@ internal SecurityRulesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Creates or updates a security rule in the specified network security group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// The name of the security rule. - /// - /// - /// Parameters supplied to the create or update network security rule - /// operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// Creates or updates a security rule in the specified network security group. + /// Deletes the specified network security rule. /// /// /// The name of the resource group. @@ -482,105 +517,92 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The name of the security rule. /// - /// - /// Parameters supplied to the create or update network security rule - /// operation. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response + /// + /// Thrown when a required parameter is null /// - /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (networkSecurityGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); } if (securityRuleName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "securityRuleName"); + throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleName"); } - if (securityRuleParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "securityRuleParameters"); - } - if (securityRuleParameters != null) + if (Client.ApiVersion == null) { - securityRuleParameters.Validate(); - } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("securityRuleName", securityRuleName); - tracingParameters.Add("securityRuleParameters", securityRuleParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); _url = _url.Replace("{securityRuleName}", System.Uri.EscapeDataString(securityRuleName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -596,58 +618,44 @@ internal SecurityRulesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(securityRuleParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(securityRuleParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (Newtonsoft.Json.JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -657,58 +665,22 @@ internal SecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all security rules in a network security group. + /// Creates or updates a security rule in the specified network security group. /// /// /// The name of the resource group. @@ -716,86 +688,111 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The name of the network security group. /// + /// + /// The name of the security rule. + /// + /// + /// Parameters supplied to the create or update network security rule + /// operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (networkSecurityGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "networkSecurityGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); } - if (this.Client.ApiVersion == null) + if (securityRuleName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleName"); } - if (this.Client.SubscriptionId == null) + if (securityRuleParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleParameters"); + } + if (securityRuleParameters != null) + { + securityRuleParameters.Validate(); + } + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); + tracingParameters.Add("securityRuleName", securityRuleName); + tracingParameters.Add("securityRuleParameters", securityRuleParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{securityRuleName}", System.Uri.EscapeDataString(securityRuleName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -811,36 +808,42 @@ internal SecurityRulesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(securityRuleParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(securityRuleParameters, Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -848,15 +851,15 @@ internal SecurityRulesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -866,7 +869,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -879,7 +882,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -888,12 +891,30 @@ internal SecurityRulesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -910,60 +931,63 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -980,35 +1004,35 @@ internal SecurityRulesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1016,15 +1040,15 @@ internal SecurityRulesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1034,7 +1058,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1047,7 +1071,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1056,15 +1080,16 @@ internal SecurityRulesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperationsExtensions.cs index 8684216a15af3..110e7abc67d9d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for SecurityRulesOperations. @@ -34,7 +38,7 @@ public static partial class SecurityRulesOperationsExtensions /// public static void Delete(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).DeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).DeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -55,13 +59,13 @@ public static void Delete(this ISecurityRulesOperations operations, string resou /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, CancellationToken cancellationToken = default(CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, null, cancellationToken).ConfigureAwait(false); } /// - /// Deletes the specified network security rule. + /// Get the specified network security rule. /// /// /// The operations group for this extension method. @@ -75,13 +79,13 @@ public static void Delete(this ISecurityRulesOperations operations, string resou /// /// The name of the security rule. /// - public static void BeginDelete(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName) + public static SecurityRule Get(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).BeginDeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).GetAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Deletes the specified network security rule. + /// Get the specified network security rule. /// /// /// The operations group for this extension method. @@ -98,13 +102,16 @@ public static void BeginDelete(this ISecurityRulesOperations operations, string /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Get the specified network security rule. + /// Creates or updates a security rule in the specified network security group. /// /// /// The operations group for this extension method. @@ -118,13 +125,17 @@ public static void BeginDelete(this ISecurityRulesOperations operations, string /// /// The name of the security rule. /// - public static SecurityRule Get(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName) + /// + /// Parameters supplied to the create or update network security rule + /// operation. + /// + public static SecurityRule CreateOrUpdate(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).GetAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).CreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Get the specified network security rule. + /// Creates or updates a security rule in the specified network security group. /// /// /// The operations group for this extension method. @@ -138,19 +149,23 @@ public static SecurityRule Get(this ISecurityRulesOperations operations, string /// /// The name of the security rule. /// + /// + /// Parameters supplied to the create or update network security rule + /// operation. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates a security rule in the specified network security group. + /// Gets all security rules in a network security group. /// /// /// The operations group for this extension method. @@ -161,20 +176,13 @@ public static SecurityRule Get(this ISecurityRulesOperations operations, string /// /// The name of the network security group. /// - /// - /// The name of the security rule. - /// - /// - /// Parameters supplied to the create or update network security rule - /// operation. - /// - public static SecurityRule CreateOrUpdate(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters) + public static IPage List(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).CreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).ListAsync(resourceGroupName, networkSecurityGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Creates or updates a security rule in the specified network security group. + /// Gets all security rules in a network security group. /// /// /// The operations group for this extension method. @@ -185,26 +193,19 @@ public static SecurityRule CreateOrUpdate(this ISecurityRulesOperations operatio /// /// The name of the network security group. /// - /// - /// The name of the security rule. - /// - /// - /// Parameters supplied to the create or update network security rule - /// operation. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates a security rule in the specified network security group. + /// Deletes the specified network security rule. /// /// /// The operations group for this extension method. @@ -218,17 +219,13 @@ public static SecurityRule CreateOrUpdate(this ISecurityRulesOperations operatio /// /// The name of the security rule. /// - /// - /// Parameters supplied to the create or update network security rule - /// operation. - /// - public static SecurityRule BeginCreateOrUpdate(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters) + public static void BeginDelete(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).BeginDeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Creates or updates a security rule in the specified network security group. + /// Deletes the specified network security rule. /// /// /// The operations group for this extension method. @@ -242,23 +239,16 @@ public static SecurityRule BeginCreateOrUpdate(this ISecurityRulesOperations ope /// /// The name of the security rule. /// - /// - /// Parameters supplied to the create or update network security rule - /// operation. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginDeleteAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, null, cancellationToken).ConfigureAwait(false); } /// - /// Gets all security rules in a network security group. + /// Creates or updates a security rule in the specified network security group. /// /// /// The operations group for this extension method. @@ -269,13 +259,20 @@ public static SecurityRule BeginCreateOrUpdate(this ISecurityRulesOperations ope /// /// The name of the network security group. /// - public static Microsoft.Rest.Azure.IPage List(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName) + /// + /// The name of the security rule. + /// + /// + /// Parameters supplied to the create or update network security rule + /// operation. + /// + public static SecurityRule BeginCreateOrUpdate(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).ListAsync(resourceGroupName, networkSecurityGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all security rules in a network security group. + /// Creates or updates a security rule in the specified network security group. /// /// /// The operations group for this extension method. @@ -286,12 +283,19 @@ public static Microsoft.Rest.Azure.IPage List(this ISecurityRulesO /// /// The name of the network security group. /// + /// + /// The name of the security rule. + /// + /// + /// Parameters supplied to the create or update network security rule + /// operation. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -306,9 +310,9 @@ public static Microsoft.Rest.Azure.IPage List(this ISecurityRulesO /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this ISecurityRulesOperations operations, string nextPageLink) + public static IPage ListNext(this ISecurityRulesOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -323,7 +327,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this ISecurityRu /// /// The cancellation token. /// - public static async Task> ListNextAsync(this ISecurityRulesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this ISecurityRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -333,3 +337,4 @@ public static Microsoft.Rest.Azure.IPage ListNext(this ISecurityRu } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperations.cs index 28ff9a0db1aa7..131950d71684b 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// SubnetsOperations operations. /// - internal partial class SubnetsOperations : Microsoft.Rest.IServiceOperations, ISubnetsOperations + internal partial class SubnetsOperations : IServiceOperations, ISubnetsOperations { /// /// Initializes a new instance of the SubnetsOperations class. @@ -29,11 +38,11 @@ internal partial class SubnetsOperations : Microsoft.Rest.IServiceOperations internal SubnetsOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -59,16 +68,16 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, virtualNetworkName, subnetName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// Deletes the specified subnet. + /// Gets the specified subnet by virtual network and resource group. /// /// /// The name of the resource group. @@ -79,89 +88,103 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The name of the subnet. /// + /// + /// Expands referenced resources. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); } if (subnetName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subnetName"); + throw new ValidationException(ValidationRules.CannotBeNull, "subnetName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("subnetName", subnetName); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (expand != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -178,43 +201,51 @@ internal SubnetsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + 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; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -224,22 +255,40 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets the specified subnet by virtual network and resource group. + /// Creates or updates a subnet in the specified virtual network. /// /// /// The name of the resource group. @@ -250,8 +299,33 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The name of the subnet. /// - /// - /// Expands referenced resources. + /// + /// Parameters supplied to the create or update subnet operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, virtualNetworkName, subnetName, subnetParameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all subnets in a virtual network. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. /// /// /// Headers that will be added to request. @@ -259,91 +333,83 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); } - if (subnetName == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subnetName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.ApiVersion == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); - tracingParameters.Add("subnetName", subnetName); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); - } - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -360,35 +426,35 @@ internal SubnetsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -396,15 +462,15 @@ internal SubnetsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -414,7 +480,7 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -427,7 +493,7 @@ internal SubnetsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -436,49 +502,18 @@ internal SubnetsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Creates or updates a subnet in the specified virtual network. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - /// - /// Parameters supplied to the create or update subnet operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, virtualNetworkName, subnetName, subnetParameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// Creates or updates a subnet in the specified virtual network. + /// Deletes the specified subnet. /// /// /// The name of the resource group. @@ -489,100 +524,92 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The name of the subnet. /// - /// - /// Parameters supplied to the create or update subnet operation. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response + /// + /// Thrown when a required parameter is null /// - /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); } if (subnetName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subnetName"); + throw new ValidationException(ValidationRules.CannotBeNull, "subnetName"); } - if (subnetParameters == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subnetParameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.ApiVersion == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("subnetName", subnetName); - tracingParameters.Add("subnetParameters", subnetParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -598,58 +625,44 @@ internal SubnetsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(subnetParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(subnetParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 204 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (Newtonsoft.Json.JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -659,58 +672,22 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all subnets in a virtual network. + /// Creates or updates a subnet in the specified virtual network. /// /// /// The name of the resource group. @@ -718,86 +695,106 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The name of the virtual network. /// + /// + /// The name of the subnet. + /// + /// + /// Parameters supplied to the create or update subnet operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); } - if (this.Client.ApiVersion == null) + if (subnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "subnetName"); + } + if (subnetParameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "subnetParameters"); } - if (this.Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("subnetName", subnetName); + tracingParameters.Add("subnetParameters", subnetParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -813,36 +810,42 @@ internal SubnetsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(subnetParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(subnetParameters, Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -850,15 +853,15 @@ internal SubnetsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -868,7 +871,7 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -881,7 +884,7 @@ internal SubnetsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -890,12 +893,30 @@ internal SubnetsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -912,60 +933,63 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -982,35 +1006,35 @@ internal SubnetsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1018,15 +1042,15 @@ internal SubnetsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1036,7 +1060,7 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1049,7 +1073,7 @@ internal SubnetsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1058,15 +1082,16 @@ internal SubnetsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperationsExtensions.cs index c9f2d6ab8580d..e07ab7b9cb912 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for SubnetsOperations. @@ -34,7 +38,7 @@ public static partial class SubnetsOperationsExtensions /// public static void Delete(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((ISubnetsOperations)s).DeleteAsync(resourceGroupName, virtualNetworkName, subnetName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((ISubnetsOperations)s).DeleteAsync(resourceGroupName, virtualNetworkName, subnetName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -55,13 +59,13 @@ public static void Delete(this ISubnetsOperations operations, string resourceGro /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default(CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, null, cancellationToken).ConfigureAwait(false); } /// - /// Deletes the specified subnet. + /// Gets the specified subnet by virtual network and resource group. /// /// /// The operations group for this extension method. @@ -75,13 +79,16 @@ public static void Delete(this ISubnetsOperations operations, string resourceGro /// /// The name of the subnet. /// - public static void BeginDelete(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName) + /// + /// Expands referenced resources. + /// + public static Subnet Get(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string)) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((ISubnetsOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ISubnetsOperations)s).GetAsync(resourceGroupName, virtualNetworkName, subnetName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Deletes the specified subnet. + /// Gets the specified subnet by virtual network and resource group. /// /// /// The operations group for this extension method. @@ -95,16 +102,22 @@ public static void BeginDelete(this ISubnetsOperations operations, string resour /// /// The name of the subnet. /// + /// + /// Expands referenced resources. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Gets the specified subnet by virtual network and resource group. + /// Creates or updates a subnet in the specified virtual network. /// /// /// The operations group for this extension method. @@ -118,16 +131,16 @@ public static void BeginDelete(this ISubnetsOperations operations, string resour /// /// The name of the subnet. /// - /// - /// Expands referenced resources. + /// + /// Parameters supplied to the create or update subnet operation. /// - public static Subnet Get(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string)) + public static Subnet CreateOrUpdate(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ISubnetsOperations)s).GetAsync(resourceGroupName, virtualNetworkName, subnetName, expand), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ISubnetsOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets the specified subnet by virtual network and resource group. + /// Creates or updates a subnet in the specified virtual network. /// /// /// The operations group for this extension method. @@ -141,22 +154,22 @@ public static void BeginDelete(this ISubnetsOperations operations, string resour /// /// The name of the subnet. /// - /// - /// Expands referenced resources. + /// + /// Parameters supplied to the create or update subnet operation. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates a subnet in the specified virtual network. + /// Gets all subnets in a virtual network. /// /// /// The operations group for this extension method. @@ -167,19 +180,13 @@ public static void BeginDelete(this ISubnetsOperations operations, string resour /// /// The name of the virtual network. /// - /// - /// The name of the subnet. - /// - /// - /// Parameters supplied to the create or update subnet operation. - /// - public static Subnet CreateOrUpdate(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters) + public static IPage List(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ISubnetsOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ISubnetsOperations)s).ListAsync(resourceGroupName, virtualNetworkName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Creates or updates a subnet in the specified virtual network. + /// Gets all subnets in a virtual network. /// /// /// The operations group for this extension method. @@ -190,25 +197,19 @@ public static Subnet CreateOrUpdate(this ISubnetsOperations operations, string r /// /// The name of the virtual network. /// - /// - /// The name of the subnet. - /// - /// - /// Parameters supplied to the create or update subnet operation. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates a subnet in the specified virtual network. + /// Deletes the specified subnet. /// /// /// The operations group for this extension method. @@ -222,16 +223,13 @@ public static Subnet CreateOrUpdate(this ISubnetsOperations operations, string r /// /// The name of the subnet. /// - /// - /// Parameters supplied to the create or update subnet operation. - /// - public static Subnet BeginCreateOrUpdate(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters) + public static void BeginDelete(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ISubnetsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((ISubnetsOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Creates or updates a subnet in the specified virtual network. + /// Deletes the specified subnet. /// /// /// The operations group for this extension method. @@ -245,22 +243,16 @@ public static Subnet BeginCreateOrUpdate(this ISubnetsOperations operations, str /// /// The name of the subnet. /// - /// - /// Parameters supplied to the create or update subnet operation. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginDeleteAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, null, cancellationToken).ConfigureAwait(false); } /// - /// Gets all subnets in a virtual network. + /// Creates or updates a subnet in the specified virtual network. /// /// /// The operations group for this extension method. @@ -271,13 +263,19 @@ public static Subnet BeginCreateOrUpdate(this ISubnetsOperations operations, str /// /// The name of the virtual network. /// - public static Microsoft.Rest.Azure.IPage List(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName) + /// + /// The name of the subnet. + /// + /// + /// Parameters supplied to the create or update subnet operation. + /// + public static Subnet BeginCreateOrUpdate(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ISubnetsOperations)s).ListAsync(resourceGroupName, virtualNetworkName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ISubnetsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all subnets in a virtual network. + /// Creates or updates a subnet in the specified virtual network. /// /// /// The operations group for this extension method. @@ -288,12 +286,18 @@ public static Microsoft.Rest.Azure.IPage List(this ISubnetsOperations op /// /// The name of the virtual network. /// + /// + /// The name of the subnet. + /// + /// + /// Parameters supplied to the create or update subnet operation. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -308,9 +312,9 @@ public static Microsoft.Rest.Azure.IPage List(this ISubnetsOperations op /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this ISubnetsOperations operations, string nextPageLink) + public static IPage ListNext(this ISubnetsOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ISubnetsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ISubnetsOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -325,7 +329,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this ISubnetsOperation /// /// The cancellation token. /// - public static async Task> ListNextAsync(this ISubnetsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this ISubnetsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -335,3 +339,4 @@ public static Microsoft.Rest.Azure.IPage ListNext(this ISubnetsOperation } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperations.cs index 21c97d81ac3d7..f8551f5188015 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// UsagesOperations operations. /// - internal partial class UsagesOperations : Microsoft.Rest.IServiceOperations, IUsagesOperations + internal partial class UsagesOperations : IServiceOperations, IUsagesOperations { /// /// Initializes a new instance of the UsagesOperations class. @@ -29,11 +38,11 @@ internal partial class UsagesOperations : Microsoft.Rest.IServiceOperations internal UsagesOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -53,81 +62,84 @@ internal UsagesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (location == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); + throw new ValidationException(ValidationRules.CannotBeNull, "location"); } if (location != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(location, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "location", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "location", "^[-\\w\\._]+$"); } } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -144,35 +156,35 @@ internal UsagesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -180,15 +192,15 @@ internal UsagesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -198,7 +210,7 @@ internal UsagesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -211,7 +223,7 @@ internal UsagesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -220,12 +232,12 @@ internal UsagesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -242,60 +254,63 @@ internal UsagesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -312,35 +327,35 @@ internal UsagesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -348,15 +363,15 @@ internal UsagesOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -366,7 +381,7 @@ internal UsagesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -379,7 +394,7 @@ internal UsagesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -388,15 +403,16 @@ internal UsagesOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperationsExtensions.cs index 5522892f2854c..654690497acf6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for UsagesOperations. @@ -26,9 +30,9 @@ public static partial class UsagesOperationsExtensions /// /// The location where resource usage is queried. /// - public static Microsoft.Rest.Azure.IPage List(this IUsagesOperations operations, string location) + public static IPage List(this IUsagesOperations operations, string location) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IUsagesOperations)s).ListAsync(location), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IUsagesOperations)s).ListAsync(location), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -43,7 +47,7 @@ public static Microsoft.Rest.Azure.IPage List(this IUsagesOperations oper /// /// The cancellation token. /// - public static async Task> ListAsync(this IUsagesOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IUsagesOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) { @@ -60,9 +64,9 @@ public static Microsoft.Rest.Azure.IPage List(this IUsagesOperations oper /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this IUsagesOperations operations, string nextPageLink) + public static IPage ListNext(this IUsagesOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IUsagesOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IUsagesOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -77,7 +81,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IUsagesOperations /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IUsagesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IUsagesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -87,3 +91,4 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IUsagesOperations } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs index 271d2afc5fad0..2e19fbe5d80ea 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// VirtualNetworkGatewayConnectionsOperations operations. /// - internal partial class VirtualNetworkGatewayConnectionsOperations : Microsoft.Rest.IServiceOperations, IVirtualNetworkGatewayConnectionsOperations + internal partial class VirtualNetworkGatewayConnectionsOperations : IServiceOperations, IVirtualNetworkGatewayConnectionsOperations { /// /// Initializes a new instance of the VirtualNetworkGatewayConnectionsOperations class. @@ -29,11 +38,11 @@ internal partial class VirtualNetworkGatewayConnectionsOperations : Microsoft.Re /// internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -61,19 +70,18 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// Creates or updates a virtual network gateway connection in the specified - /// resource group. + /// Gets the specified virtual network gateway connection by resource group. /// /// /// The name of the resource group. @@ -81,99 +89,89 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The name of the virtual network gateway connection. /// - /// - /// Parameters supplied to the create or update virtual network gateway - /// 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 System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkGatewayConnectionName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); - } - if (parameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -189,42 +187,36 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -232,15 +224,15 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -250,7 +242,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -263,25 +255,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -290,18 +264,18 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets the specified virtual network gateway connection by resource group. + /// Deletes the specified virtual network Gateway connection. /// /// /// The name of the resource group. @@ -310,85 +284,145 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// The name of the virtual network gateway connection. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + resourceGroupName, virtualNetworkGatewayConnectionName, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + /// network gateway connection shared key for passed virtual network gateway + /// connection in the specified resource group through Network resource + /// provider. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway connection name. + /// + /// + /// Parameters supplied to the Begin Set Virtual Network Gateway connection + /// Shared key operation throughNetwork resource provider. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> SetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginSetSharedKeyWithHttpMessagesAsync( + resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves + /// information about the specified virtual network gateway connection shared + /// key through Network resource provider. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway connection shared key name. + /// + /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkGatewayConnectionName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSharedKey", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -405,35 +439,35 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -441,15 +475,15 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -459,7 +493,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -472,7 +506,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -481,125 +515,100 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Deletes the specified virtual network Gateway connection. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( - resourceGroupName, virtualNetworkGatewayConnectionName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - - /// - /// Deletes the specified virtual network Gateway connection. + /// The List VirtualNetworkGatewayConnections operation retrieves all the + /// virtual network gateways connections created. /// /// /// The name of the resource group. /// - /// - /// The name of the virtual network gateway connection. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualNetworkGatewayConnectionName == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.ApiVersion == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -616,43 +625,51 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + 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; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -662,35 +679,53 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the + /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets the /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// gateway connection in the specified resource group through Network resource + /// provider. /// /// /// The name of the resource group. /// /// - /// The virtual network gateway connection name. + /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the Begin Set Virtual Network Gateway connection - /// Shared key operation throughNetwork resource provider. + /// Parameters supplied to the begin reset virtual network gateway connection + /// shared key operation through network resource provider. /// /// /// The headers that will be added to request. @@ -698,31 +733,27 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> SetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> ResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginSetSharedKeyWithHttpMessagesAsync( + // Send request + AzureOperationResponse _response = await BeginResetSharedKeyWithHttpMessagesAsync( resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the - /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. /// /// /// The name of the resource group. /// /// - /// The virtual network gateway connection name. + /// The name of the virtual network gateway connection. /// /// - /// Parameters supplied to the Begin Set Virtual Network Gateway connection - /// Shared key operation throughNetwork resource provider. + /// Parameters supplied to the create or update virtual network gateway + /// connection operation. /// /// /// Headers that will be added to request. @@ -730,89 +761,92 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginSetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkGatewayConnectionName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } if (parameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } if (parameters != null) { parameters.Validate(); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginSetSharedKey", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -830,40 +864,40 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie string _requestContent = null; if(parameters != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -871,15 +905,15 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -889,7 +923,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -897,12 +931,12 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -911,16 +945,16 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response - if ((int)_statusCode == 200) + if ((int)_statusCode == 201) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -929,26 +963,24 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves - /// information about the specified virtual network gateway connection shared - /// key through Network resource provider. + /// Deletes the specified virtual network Gateway connection. /// /// /// The name of the resource group. /// /// - /// The virtual network gateway connection shared key name. + /// The name of the virtual network gateway connection. /// /// /// Headers that will be added to request. @@ -956,80 +988,80 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response + /// + /// Thrown when a required parameter is null /// - /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkGatewayConnectionName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSharedKey", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1046,51 +1078,43 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (Newtonsoft.Json.JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1100,119 +1124,128 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// The List VirtualNetworkGatewayConnections operation retrieves all the - /// virtual network gateways connections created. + /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + /// network gateway connection shared key for passed virtual network gateway + /// connection in the specified resource group through Network resource + /// provider. /// /// /// The name of the resource group. /// + /// + /// The virtual network gateway connection name. + /// + /// + /// Parameters supplied to the Begin Set Virtual Network Gateway connection + /// Shared key operation throughNetwork resource provider. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginSetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (virtualNetworkGatewayConnectionName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } - if (this.Client.SubscriptionId == null) + if (parameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginSetSharedKey", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1228,36 +1261,42 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 201 && (int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1265,15 +1304,15 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1283,7 +1322,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1291,12 +1330,30 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1305,12 +1362,12 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1318,38 +1375,8 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets the /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. - /// - /// - /// The name of the resource group. - /// - /// - /// The virtual network gateway connection reset shared key Name. - /// - /// - /// Parameters supplied to the begin reset virtual network gateway connection - /// shared key operation through network resource provider. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> ResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginResetSharedKeyWithHttpMessagesAsync( - resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - - /// - /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets the - /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// gateway connection in the specified resource group through Network resource + /// provider. /// /// /// The name of the resource group. @@ -1367,89 +1394,92 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkGatewayConnectionName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } if (parameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } if (parameters != null) { parameters.Validate(); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginResetSharedKey", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginResetSharedKey", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1467,40 +1497,40 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie string _requestContent = null; if(parameters != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1508,15 +1538,15 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1526,7 +1556,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1539,7 +1569,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1548,12 +1578,12 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1571,60 +1601,63 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1641,35 +1674,35 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1677,15 +1710,15 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1695,7 +1728,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1708,7 +1741,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1717,15 +1750,16 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperationsExtensions.cs index 48d410d0319e7..a27950a0235a4 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for VirtualNetworkGatewayConnectionsOperations. @@ -36,7 +40,7 @@ public static partial class VirtualNetworkGatewayConnectionsOperationsExtensions /// public static VirtualNetworkGatewayConnection CreateOrUpdate(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -59,7 +63,7 @@ public static VirtualNetworkGatewayConnection CreateOrUpdate(this IVirtualNetwor /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -68,8 +72,7 @@ public static VirtualNetworkGatewayConnection CreateOrUpdate(this IVirtualNetwor } /// - /// Creates or updates a virtual network gateway connection in the specified - /// resource group. + /// Gets the specified virtual network gateway connection by resource group. /// /// /// The operations group for this extension method. @@ -80,18 +83,13 @@ public static VirtualNetworkGatewayConnection CreateOrUpdate(this IVirtualNetwor /// /// The name of the virtual network gateway connection. /// - /// - /// Parameters supplied to the create or update virtual network gateway - /// connection operation. - /// - public static VirtualNetworkGatewayConnection BeginCreateOrUpdate(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters) + public static VirtualNetworkGatewayConnection Get(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).GetAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Creates or updates a virtual network gateway connection in the specified - /// resource group. + /// Gets the specified virtual network gateway connection by resource group. /// /// /// The operations group for this extension method. @@ -102,23 +100,19 @@ public static VirtualNetworkGatewayConnection BeginCreateOrUpdate(this IVirtualN /// /// The name of the virtual network gateway connection. /// - /// - /// Parameters supplied to the create or update virtual network gateway - /// connection operation. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the specified virtual network gateway connection by resource group. + /// Deletes the specified virtual network Gateway connection. /// /// /// The operations group for this extension method. @@ -129,13 +123,13 @@ public static VirtualNetworkGatewayConnection BeginCreateOrUpdate(this IVirtualN /// /// The name of the virtual network gateway connection. /// - public static VirtualNetworkGatewayConnection Get(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) + public static void Delete(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).GetAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).DeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets the specified virtual network gateway connection by resource group. + /// Deletes the specified virtual network Gateway connection. /// /// /// The operations group for this extension method. @@ -149,16 +143,16 @@ public static VirtualNetworkGatewayConnection Get(this IVirtualNetworkGatewayCon /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false); } /// - /// Deletes the specified virtual network Gateway connection. + /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + /// network gateway connection shared key for passed virtual network gateway + /// connection in the specified resource group through Network resource + /// provider. /// /// /// The operations group for this extension method. @@ -167,15 +161,22 @@ public static VirtualNetworkGatewayConnection Get(this IVirtualNetworkGatewayCon /// The name of the resource group. /// /// - /// The name of the virtual network gateway connection. + /// The virtual network gateway connection name. /// - public static void Delete(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) + /// + /// Parameters supplied to the Begin Set Virtual Network Gateway connection + /// Shared key operation throughNetwork resource provider. + /// + public static ConnectionSharedKey SetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).DeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).SetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Deletes the specified virtual network Gateway connection. + /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + /// network gateway connection shared key for passed virtual network gateway + /// connection in the specified resource group through Network resource + /// provider. /// /// /// The operations group for this extension method. @@ -184,18 +185,27 @@ public static void Delete(this IVirtualNetworkGatewayConnectionsOperations opera /// The name of the resource group. /// /// - /// The name of the virtual network gateway connection. + /// The virtual network gateway connection name. + /// + /// + /// Parameters supplied to the Begin Set Virtual Network Gateway connection + /// Shared key operation throughNetwork resource provider. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task SetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.SetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Deletes the specified virtual network Gateway connection. + /// The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves + /// information about the specified virtual network gateway connection shared + /// key through Network resource provider. /// /// /// The operations group for this extension method. @@ -204,15 +214,17 @@ public static void Delete(this IVirtualNetworkGatewayConnectionsOperations opera /// The name of the resource group. /// /// - /// The name of the virtual network gateway connection. + /// The virtual network gateway connection shared key name. /// - public static void BeginDelete(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) + public static ConnectionSharedKey GetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).GetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Deletes the specified virtual network Gateway connection. + /// The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves + /// information about the specified virtual network gateway connection shared + /// key through Network resource provider. /// /// /// The operations group for this extension method. @@ -221,21 +233,22 @@ public static void BeginDelete(this IVirtualNetworkGatewayConnectionsOperations /// The name of the resource group. /// /// - /// The name of the virtual network gateway connection. + /// The virtual network gateway connection shared key name. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the - /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// The List VirtualNetworkGatewayConnections operation retrieves all the + /// virtual network gateways connections created. /// /// /// The operations group for this extension method. @@ -243,23 +256,14 @@ public static void BeginDelete(this IVirtualNetworkGatewayConnectionsOperations /// /// The name of the resource group. /// - /// - /// The virtual network gateway connection name. - /// - /// - /// Parameters supplied to the Begin Set Virtual Network Gateway connection - /// Shared key operation throughNetwork resource provider. - /// - public static ConnectionSharedKey SetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters) + public static IPage List(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).SetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the - /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// The List VirtualNetworkGatewayConnections operation retrieves all the + /// virtual network gateways connections created. /// /// /// The operations group for this extension method. @@ -267,29 +271,22 @@ public static ConnectionSharedKey SetSharedKey(this IVirtualNetworkGatewayConnec /// /// The name of the resource group. /// - /// - /// The virtual network gateway connection name. - /// - /// - /// Parameters supplied to the Begin Set Virtual Network Gateway connection - /// Shared key operation throughNetwork resource provider. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task SetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.SetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the + /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets the /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// gateway connection in the specified resource group through Network resource + /// provider. /// /// /// The operations group for this extension method. @@ -298,22 +295,22 @@ public static ConnectionSharedKey SetSharedKey(this IVirtualNetworkGatewayConnec /// The name of the resource group. /// /// - /// The virtual network gateway connection name. + /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the Begin Set Virtual Network Gateway connection - /// Shared key operation throughNetwork resource provider. + /// Parameters supplied to the begin reset virtual network gateway connection + /// shared key operation through network resource provider. /// - public static ConnectionSharedKey BeginSetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters) + public static ConnectionResetSharedKey ResetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).ResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the + /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets the /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// gateway connection in the specified resource group through Network resource + /// provider. /// /// /// The operations group for this extension method. @@ -322,27 +319,26 @@ public static ConnectionSharedKey BeginSetSharedKey(this IVirtualNetworkGatewayC /// The name of the resource group. /// /// - /// The virtual network gateway connection name. + /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the Begin Set Virtual Network Gateway connection - /// Shared key operation throughNetwork resource provider. + /// Parameters supplied to the begin reset virtual network gateway connection + /// shared key operation through network resource provider. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginSetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task ResetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginSetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ResetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves - /// information about the specified virtual network gateway connection shared - /// key through Network resource provider. + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. /// /// /// The operations group for this extension method. @@ -351,17 +347,20 @@ public static ConnectionSharedKey BeginSetSharedKey(this IVirtualNetworkGatewayC /// The name of the resource group. /// /// - /// The virtual network gateway connection shared key name. + /// The name of the virtual network gateway connection. /// - public static ConnectionSharedKey GetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) + /// + /// Parameters supplied to the create or update virtual network gateway + /// connection operation. + /// + public static VirtualNetworkGatewayConnection BeginCreateOrUpdate(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).GetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves - /// information about the specified virtual network gateway connection shared - /// key through Network resource provider. + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. /// /// /// The operations group for this extension method. @@ -370,22 +369,25 @@ public static ConnectionSharedKey GetSharedKey(this IVirtualNetworkGatewayConnec /// The name of the resource group. /// /// - /// The virtual network gateway connection shared key name. + /// The name of the virtual network gateway connection. + /// + /// + /// Parameters supplied to the create or update virtual network gateway + /// connection operation. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The List VirtualNetworkGatewayConnections operation retrieves all the - /// virtual network gateways connections created. + /// Deletes the specified virtual network Gateway connection. /// /// /// The operations group for this extension method. @@ -393,14 +395,16 @@ public static ConnectionSharedKey GetSharedKey(this IVirtualNetworkGatewayConnec /// /// The name of the resource group. /// - public static Microsoft.Rest.Azure.IPage List(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName) + /// + /// The name of the virtual network gateway connection. + /// + public static void BeginDelete(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List VirtualNetworkGatewayConnections operation retrieves all the - /// virtual network gateways connections created. + /// Deletes the specified virtual network Gateway connection. /// /// /// The operations group for this extension method. @@ -408,22 +412,22 @@ public static Microsoft.Rest.Azure.IPage List(t /// /// The name of the resource group. /// + /// + /// The name of the virtual network gateway connection. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginDeleteAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false); } /// - /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets the - /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + /// network gateway connection shared key for passed virtual network gateway + /// connection in the specified resource group through Network resource + /// provider. /// /// /// The operations group for this extension method. @@ -432,22 +436,22 @@ public static Microsoft.Rest.Azure.IPage List(t /// The name of the resource group. /// /// - /// The virtual network gateway connection reset shared key Name. + /// The virtual network gateway connection name. /// /// - /// Parameters supplied to the begin reset virtual network gateway connection - /// shared key operation through network resource provider. + /// Parameters supplied to the Begin Set Virtual Network Gateway connection + /// Shared key operation throughNetwork resource provider. /// - public static ConnectionResetSharedKey ResetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters) + public static ConnectionSharedKey BeginSetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).ResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets the - /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + /// network gateway connection shared key for passed virtual network gateway + /// connection in the specified resource group through Network resource + /// provider. /// /// /// The operations group for this extension method. @@ -456,18 +460,18 @@ public static ConnectionResetSharedKey ResetSharedKey(this IVirtualNetworkGatewa /// The name of the resource group. /// /// - /// The virtual network gateway connection reset shared key Name. + /// The virtual network gateway connection name. /// /// - /// Parameters supplied to the begin reset virtual network gateway connection - /// shared key operation through network resource provider. + /// Parameters supplied to the Begin Set Virtual Network Gateway connection + /// Shared key operation throughNetwork resource provider. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task ResetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginSetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ResetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginSetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -476,8 +480,8 @@ public static ConnectionResetSharedKey ResetSharedKey(this IVirtualNetworkGatewa /// /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets the /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// gateway connection in the specified resource group through Network resource + /// provider. /// /// /// The operations group for this extension method. @@ -494,14 +498,14 @@ public static ConnectionResetSharedKey ResetSharedKey(this IVirtualNetworkGatewa /// public static ConnectionResetSharedKey BeginResetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets the /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// gateway connection in the specified resource group through Network resource + /// provider. /// /// /// The operations group for this extension method. @@ -519,7 +523,7 @@ public static ConnectionResetSharedKey BeginResetSharedKey(this IVirtualNetworkG /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginResetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginResetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginResetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -537,9 +541,9 @@ public static ConnectionResetSharedKey BeginResetSharedKey(this IVirtualNetworkG /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualNetworkGatewayConnectionsOperations operations, string nextPageLink) + public static IPage ListNext(this IVirtualNetworkGatewayConnectionsOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -555,7 +559,7 @@ public static Microsoft.Rest.Azure.IPage ListNe /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -565,3 +569,4 @@ public static Microsoft.Rest.Azure.IPage ListNe } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperations.cs index 02bf147063af0..9140fd48454d0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// VirtualNetworkGatewaysOperations operations. /// - internal partial class VirtualNetworkGatewaysOperations : Microsoft.Rest.IServiceOperations, IVirtualNetworkGatewaysOperations + internal partial class VirtualNetworkGatewaysOperations : IServiceOperations, IVirtualNetworkGatewaysOperations { /// /// Initializes a new instance of the VirtualNetworkGatewaysOperations class. @@ -29,11 +38,11 @@ internal partial class VirtualNetworkGatewaysOperations : Microsoft.Rest.IServic /// internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -60,19 +69,18 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, virtualNetworkGatewayName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// Creates or updates a virtual network gateway in the specified resource - /// group. + /// Gets the specified virtual network gateway by resource group. /// /// /// The name of the resource group. @@ -80,98 +88,89 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The name of the virtual network gateway. /// - /// - /// Parameters supplied to create or update virtual network gateway operation. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkGatewayName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (parameters == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (parameters != null) + if (Client.SubscriptionId == null) { - parameters.Validate(); - } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -187,42 +186,36 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -230,15 +223,15 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -248,7 +241,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -261,25 +254,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -288,18 +263,18 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets the specified virtual network gateway by resource group. + /// Deletes the specified virtual network gateway. /// /// /// The name of the resource group. @@ -308,85 +283,102 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// The name of the virtual network gateway. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + resourceGroupName, virtualNetworkGatewayName, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// Gets all virtual network gateways by resource group. + /// + /// + /// The name of the resource group. + /// + /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualNetworkGatewayName == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.ApiVersion == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -403,35 +395,35 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -439,15 +431,15 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -457,7 +449,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -470,7 +462,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -479,18 +471,19 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Deletes the specified virtual network gateway. + /// Resets the primary of the virtual network gateway in the specified resource + /// group. /// /// /// The name of the resource group. @@ -498,22 +491,27 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The name of the virtual network gateway. /// + /// + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> ResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( - resourceGroupName, virtualNetworkGatewayName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + AzureOperationResponse _response = await BeginResetWithHttpMessagesAsync( + resourceGroupName, virtualNetworkGatewayName, gatewayVip, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// Deletes the specified virtual network gateway. + /// Generates VPN client package for P2S client of the virtual network gateway + /// in the specified resource group. /// /// /// The name of the resource group. @@ -521,83 +519,102 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The name of the virtual network gateway. /// + /// + /// Parameters supplied to the generate virtual network gateway VPN client + /// package operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GeneratevpnclientpackageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkGatewayName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Generatevpnclientpackage", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -613,44 +630,58 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) + if ((int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + 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; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -660,100 +691,143 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all virtual network gateways by resource group. + /// Creates or updates a virtual network gateway in the specified resource + /// group. /// /// /// The name of the resource group. /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Parameters supplied to create or update virtual network gateway operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (virtualNetworkGatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (this.Client.ApiVersion == null) + if (parameters != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + parameters.Validate(); } - if (this.Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -769,36 +843,42 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -806,15 +886,15 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -824,7 +904,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -837,7 +917,25 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -846,47 +944,18 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Resets the primary of the virtual network gateway in the specified - /// resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Virtual network gateway vip address supplied to the begin reset of the - /// active-active feature enabled gateway. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> ResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginResetWithHttpMessagesAsync( - resourceGroupName, virtualNetworkGatewayName, gatewayVip, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - - /// - /// Resets the primary of the virtual network gateway in the specified - /// resource group. + /// Deletes the specified virtual network gateway. /// /// /// The name of the resource group. @@ -894,95 +963,86 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The name of the virtual network gateway. /// - /// - /// Virtual network gateway vip address supplied to the begin reset of the - /// active-active feature enabled gateway. - /// /// /// 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 System.Threading.Tasks.Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkGatewayName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("gatewayVip", gatewayVip); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginReset", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (gatewayVip != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("gatewayVip={0}", System.Uri.EscapeDataString(gatewayVip))); - } - if (this.Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -999,51 +1059,43 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (Newtonsoft.Json.JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1053,41 +1105,23 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Generates VPN client package for P2S client of the virtual network gateway - /// in the specified resource group. + /// Resets the primary of the virtual network gateway in the specified resource + /// group. /// /// /// The name of the resource group. @@ -1095,9 +1129,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The name of the virtual network gateway. /// - /// - /// Parameters supplied to the generate virtual network gateway VPN client - /// package operation. + /// + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. /// /// /// Headers that will be added to request. @@ -1105,89 +1139,88 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GeneratevpnclientpackageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkGatewayName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (parameters == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (parameters != null) + if (Client.SubscriptionId == null) { - parameters.Validate(); - } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("gatewayVip", gatewayVip); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Generatevpnclientpackage", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginReset", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (gatewayVip != null) + { + _queryParameters.Add(string.Format("gatewayVip={0}", System.Uri.EscapeDataString(gatewayVip))); + } + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1203,42 +1236,36 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202) + if ((int)_statusCode != 202 && (int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1246,15 +1273,15 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1264,7 +1291,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1272,12 +1299,12 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 202) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1286,12 +1313,12 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1308,60 +1335,63 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1378,35 +1408,35 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1414,15 +1444,15 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1432,7 +1462,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1445,7 +1475,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1454,15 +1484,16 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs index 3f0b46eeba46b..3551911ae292b 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for VirtualNetworkGatewaysOperations. @@ -35,7 +39,7 @@ public static partial class VirtualNetworkGatewaysOperationsExtensions /// public static VirtualNetworkGateway CreateOrUpdate(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -57,7 +61,7 @@ public static VirtualNetworkGateway CreateOrUpdate(this IVirtualNetworkGatewaysO /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -66,8 +70,7 @@ public static VirtualNetworkGateway CreateOrUpdate(this IVirtualNetworkGatewaysO } /// - /// Creates or updates a virtual network gateway in the specified resource - /// group. + /// Gets the specified virtual network gateway by resource group. /// /// /// The operations group for this extension method. @@ -78,17 +81,13 @@ public static VirtualNetworkGateway CreateOrUpdate(this IVirtualNetworkGatewaysO /// /// The name of the virtual network gateway. /// - /// - /// Parameters supplied to create or update virtual network gateway operation. - /// - public static VirtualNetworkGateway BeginCreateOrUpdate(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters) + public static VirtualNetworkGateway Get(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).GetAsync(resourceGroupName, virtualNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Creates or updates a virtual network gateway in the specified resource - /// group. + /// Gets the specified virtual network gateway by resource group. /// /// /// The operations group for this extension method. @@ -99,22 +98,19 @@ public static VirtualNetworkGateway BeginCreateOrUpdate(this IVirtualNetworkGate /// /// The name of the virtual network gateway. /// - /// - /// Parameters supplied to create or update virtual network gateway operation. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the specified virtual network gateway by resource group. + /// Deletes the specified virtual network gateway. /// /// /// The operations group for this extension method. @@ -125,13 +121,13 @@ public static VirtualNetworkGateway BeginCreateOrUpdate(this IVirtualNetworkGate /// /// The name of the virtual network gateway. /// - public static VirtualNetworkGateway Get(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + public static void Delete(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).GetAsync(resourceGroupName, virtualNetworkGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).DeleteAsync(resourceGroupName, virtualNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets the specified virtual network gateway by resource group. + /// Deletes the specified virtual network gateway. /// /// /// The operations group for this extension method. @@ -145,16 +141,13 @@ public static VirtualNetworkGateway Get(this IVirtualNetworkGatewaysOperations o /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// Deletes the specified virtual network gateway. + /// Gets all virtual network gateways by resource group. /// /// /// The operations group for this extension method. @@ -162,16 +155,13 @@ public static VirtualNetworkGateway Get(this IVirtualNetworkGatewaysOperations o /// /// The name of the resource group. /// - /// - /// The name of the virtual network gateway. - /// - public static void Delete(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + public static IPage List(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).DeleteAsync(resourceGroupName, virtualNetworkGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Deletes the specified virtual network gateway. + /// Gets all virtual network gateways by resource group. /// /// /// The operations group for this extension method. @@ -179,19 +169,20 @@ public static void Delete(this IVirtualNetworkGatewaysOperations operations, str /// /// The name of the resource group. /// - /// - /// The name of the virtual network gateway. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Deletes the specified virtual network gateway. + /// Resets the primary of the virtual network gateway in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -202,13 +193,18 @@ public static void Delete(this IVirtualNetworkGatewaysOperations operations, str /// /// The name of the virtual network gateway. /// - public static void BeginDelete(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + /// + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. + /// + public static VirtualNetworkGateway Reset(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string)) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkGatewayName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Deletes the specified virtual network gateway. + /// Resets the primary of the virtual network gateway in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -219,16 +215,24 @@ public static void BeginDelete(this IVirtualNetworkGatewaysOperations operations /// /// The name of the virtual network gateway. /// + /// + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task ResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.ResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Gets all virtual network gateways by resource group. + /// Generates VPN client package for P2S client of the virtual network gateway + /// in the specified resource group. /// /// /// The operations group for this extension method. @@ -236,13 +240,21 @@ public static void BeginDelete(this IVirtualNetworkGatewaysOperations operations /// /// The name of the resource group. /// - public static Microsoft.Rest.Azure.IPage List(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName) + /// + /// The name of the virtual network gateway. + /// + /// + /// Parameters supplied to the generate virtual network gateway VPN client + /// package operation. + /// + public static string Generatevpnclientpackage(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).GeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all virtual network gateways by resource group. + /// Generates VPN client package for P2S client of the virtual network gateway + /// in the specified resource group. /// /// /// The operations group for this extension method. @@ -250,20 +262,27 @@ public static Microsoft.Rest.Azure.IPage List(this IVirtu /// /// The name of the resource group. /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Parameters supplied to the generate virtual network gateway VPN client + /// package operation. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GeneratevpnclientpackageAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GeneratevpnclientpackageWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Resets the primary of the virtual network gateway in the specified - /// resource group. + /// Creates or updates a virtual network gateway in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -274,18 +293,17 @@ public static Microsoft.Rest.Azure.IPage List(this IVirtu /// /// The name of the virtual network gateway. /// - /// - /// Virtual network gateway vip address supplied to the begin reset of the - /// active-active feature enabled gateway. + /// + /// Parameters supplied to create or update virtual network gateway operation. /// - public static VirtualNetworkGateway Reset(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string)) + public static VirtualNetworkGateway BeginCreateOrUpdate(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Resets the primary of the virtual network gateway in the specified - /// resource group. + /// Creates or updates a virtual network gateway in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -296,24 +314,22 @@ public static Microsoft.Rest.Azure.IPage List(this IVirtu /// /// The name of the virtual network gateway. /// - /// - /// Virtual network gateway vip address supplied to the begin reset of the - /// active-active feature enabled gateway. + /// + /// Parameters supplied to create or update virtual network gateway operation. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task ResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Resets the primary of the virtual network gateway in the specified - /// resource group. + /// Deletes the specified virtual network gateway. /// /// /// The operations group for this extension method. @@ -324,18 +340,13 @@ public static Microsoft.Rest.Azure.IPage List(this IVirtu /// /// The name of the virtual network gateway. /// - /// - /// Virtual network gateway vip address supplied to the begin reset of the - /// active-active feature enabled gateway. - /// - public static VirtualNetworkGateway BeginReset(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string)) + public static void BeginDelete(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Resets the primary of the virtual network gateway in the specified - /// resource group. + /// Deletes the specified virtual network gateway. /// /// /// The operations group for this extension method. @@ -346,24 +357,17 @@ public static Microsoft.Rest.Azure.IPage List(this IVirtu /// /// The name of the virtual network gateway. /// - /// - /// Virtual network gateway vip address supplied to the begin reset of the - /// active-active feature enabled gateway. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginDeleteAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// Generates VPN client package for P2S client of the virtual network gateway - /// in the specified resource group. + /// Resets the primary of the virtual network gateway in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -374,18 +378,18 @@ public static Microsoft.Rest.Azure.IPage List(this IVirtu /// /// The name of the virtual network gateway. /// - /// - /// Parameters supplied to the generate virtual network gateway VPN client - /// package operation. + /// + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. /// - public static string Generatevpnclientpackage(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters) + public static VirtualNetworkGateway BeginReset(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).GeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Generates VPN client package for P2S client of the virtual network gateway - /// in the specified resource group. + /// Resets the primary of the virtual network gateway in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -396,16 +400,16 @@ public static string Generatevpnclientpackage(this IVirtualNetworkGatewaysOperat /// /// The name of the virtual network gateway. /// - /// - /// Parameters supplied to the generate virtual network gateway VPN client - /// package operation. + /// + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GeneratevpnclientpackageAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GeneratevpnclientpackageWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -420,9 +424,9 @@ public static string Generatevpnclientpackage(this IVirtualNetworkGatewaysOperat /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualNetworkGatewaysOperations operations, string nextPageLink) + public static IPage ListNext(this IVirtualNetworkGatewaysOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -437,7 +441,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IV /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IVirtualNetworkGatewaysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IVirtualNetworkGatewaysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -447,3 +451,4 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IV } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperations.cs index 688aa160eba10..9da9312cb37d0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// VirtualNetworkPeeringsOperations operations. /// - internal partial class VirtualNetworkPeeringsOperations : Microsoft.Rest.IServiceOperations, IVirtualNetworkPeeringsOperations + internal partial class VirtualNetworkPeeringsOperations : IServiceOperations, IVirtualNetworkPeeringsOperations { /// /// Initializes a new instance of the VirtualNetworkPeeringsOperations class. @@ -29,11 +38,11 @@ internal partial class VirtualNetworkPeeringsOperations : Microsoft.Rest.IServic /// internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -59,16 +68,16 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// Deletes the specified virtual network peering. + /// Gets the specified virtual network peering. /// /// /// The name of the resource group. @@ -85,83 +94,89 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); } if (virtualNetworkPeeringName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("virtualNetworkPeeringName", virtualNetworkPeeringName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{virtualNetworkPeeringName}", System.Uri.EscapeDataString(virtualNetworkPeeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -178,43 +193,51 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + 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; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -224,22 +247,40 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets the specified virtual network peering. + /// Creates or updates a peering in the specified virtual network. /// /// /// The name of the resource group. @@ -248,7 +289,36 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// The name of the virtual network. /// /// - /// The name of the virtual network peering. + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update virtual network peering + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all virtual network peerings in a virtual network. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. /// /// /// Headers that will be added to request. @@ -256,86 +326,83 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); - } - if (virtualNetworkPeeringName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); - tracingParameters.Add("virtualNetworkPeeringName", virtualNetworkPeeringName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{virtualNetworkPeeringName}", System.Uri.EscapeDataString(virtualNetworkPeeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -352,35 +419,35 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -388,15 +455,15 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -406,7 +473,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -419,7 +486,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -428,50 +495,18 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Creates or updates a peering in the specified virtual network. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update virtual network peering - /// operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// Creates or updates a peering in the specified virtual network. + /// Deletes the specified virtual network peering. /// /// /// The name of the resource group. @@ -480,11 +515,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// The name of the virtual network. /// /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update virtual network peering - /// operation. + /// The name of the virtual network peering. /// /// /// Headers that will be added to request. @@ -492,91 +523,86 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response + /// + /// Thrown when a required parameter is null /// - /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); } if (virtualNetworkPeeringName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); } - if (virtualNetworkPeeringParameters == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkPeeringParameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.ApiVersion == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("virtualNetworkPeeringName", virtualNetworkPeeringName); - tracingParameters.Add("virtualNetworkPeeringParameters", virtualNetworkPeeringParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{virtualNetworkPeeringName}", System.Uri.EscapeDataString(virtualNetworkPeeringName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -592,58 +618,44 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(virtualNetworkPeeringParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(virtualNetworkPeeringParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 204 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (Newtonsoft.Json.JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -653,58 +665,22 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all virtual network peerings in a virtual network. + /// Creates or updates a peering in the specified virtual network. /// /// /// The name of the resource group. @@ -712,86 +688,107 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The name of the virtual network. /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update virtual network peering + /// operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + } + if (virtualNetworkPeeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); + } + if (virtualNetworkPeeringParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringParameters"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("virtualNetworkPeeringName", virtualNetworkPeeringName); + tracingParameters.Add("virtualNetworkPeeringParameters", virtualNetworkPeeringParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{virtualNetworkPeeringName}", System.Uri.EscapeDataString(virtualNetworkPeeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -807,36 +804,42 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(virtualNetworkPeeringParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(virtualNetworkPeeringParameters, Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -844,15 +847,15 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -862,7 +865,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -875,7 +878,25 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -884,12 +905,12 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -906,60 +927,63 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -976,35 +1000,35 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1012,15 +1036,15 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1030,7 +1054,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1043,7 +1067,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1052,15 +1076,16 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperationsExtensions.cs index a30a307d8fc6a..dae4cc56d8f26 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for VirtualNetworkPeeringsOperations. @@ -34,7 +38,7 @@ public static partial class VirtualNetworkPeeringsOperationsExtensions /// public static void Delete(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).DeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).DeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -55,13 +59,13 @@ public static void Delete(this IVirtualNetworkPeeringsOperations operations, str /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, CancellationToken cancellationToken = default(CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, null, cancellationToken).ConfigureAwait(false); } /// - /// Deletes the specified virtual network peering. + /// Gets the specified virtual network peering. /// /// /// The operations group for this extension method. @@ -75,13 +79,13 @@ public static void Delete(this IVirtualNetworkPeeringsOperations operations, str /// /// The name of the virtual network peering. /// - public static void BeginDelete(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName) + public static VirtualNetworkPeering Get(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).GetAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Deletes the specified virtual network peering. + /// Gets the specified virtual network peering. /// /// /// The operations group for this extension method. @@ -98,13 +102,16 @@ public static void BeginDelete(this IVirtualNetworkPeeringsOperations operations /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Gets the specified virtual network peering. + /// Creates or updates a peering in the specified virtual network. /// /// /// The operations group for this extension method. @@ -116,15 +123,19 @@ public static void BeginDelete(this IVirtualNetworkPeeringsOperations operations /// The name of the virtual network. /// /// - /// The name of the virtual network peering. + /// The name of the peering. /// - public static VirtualNetworkPeering Get(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName) + /// + /// Parameters supplied to the create or update virtual network peering + /// operation. + /// + public static VirtualNetworkPeering CreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).GetAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets the specified virtual network peering. + /// Creates or updates a peering in the specified virtual network. /// /// /// The operations group for this extension method. @@ -136,21 +147,25 @@ public static VirtualNetworkPeering Get(this IVirtualNetworkPeeringsOperations o /// The name of the virtual network. /// /// - /// The name of the virtual network peering. + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update virtual network peering + /// operation. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates a peering in the specified virtual network. + /// Gets all virtual network peerings in a virtual network. /// /// /// The operations group for this extension method. @@ -161,20 +176,13 @@ public static VirtualNetworkPeering Get(this IVirtualNetworkPeeringsOperations o /// /// The name of the virtual network. /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update virtual network peering - /// operation. - /// - public static VirtualNetworkPeering CreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters) + public static IPage List(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).ListAsync(resourceGroupName, virtualNetworkName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Creates or updates a peering in the specified virtual network. + /// Gets all virtual network peerings in a virtual network. /// /// /// The operations group for this extension method. @@ -185,26 +193,19 @@ public static VirtualNetworkPeering CreateOrUpdate(this IVirtualNetworkPeeringsO /// /// The name of the virtual network. /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update virtual network peering - /// operation. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates a peering in the specified virtual network. + /// Deletes the specified virtual network peering. /// /// /// The operations group for this extension method. @@ -216,19 +217,15 @@ public static VirtualNetworkPeering CreateOrUpdate(this IVirtualNetworkPeeringsO /// The name of the virtual network. /// /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update virtual network peering - /// operation. + /// The name of the virtual network peering. /// - public static VirtualNetworkPeering BeginCreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters) + public static void BeginDelete(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Creates or updates a peering in the specified virtual network. + /// Deletes the specified virtual network peering. /// /// /// The operations group for this extension method. @@ -240,25 +237,18 @@ public static VirtualNetworkPeering BeginCreateOrUpdate(this IVirtualNetworkPeer /// The name of the virtual network. /// /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create or update virtual network peering - /// operation. + /// The name of the virtual network peering. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginDeleteAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, null, cancellationToken).ConfigureAwait(false); } /// - /// Gets all virtual network peerings in a virtual network. + /// Creates or updates a peering in the specified virtual network. /// /// /// The operations group for this extension method. @@ -269,13 +259,20 @@ public static VirtualNetworkPeering BeginCreateOrUpdate(this IVirtualNetworkPeer /// /// The name of the virtual network. /// - public static Microsoft.Rest.Azure.IPage List(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName) + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update virtual network peering + /// operation. + /// + public static VirtualNetworkPeering BeginCreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).ListAsync(resourceGroupName, virtualNetworkName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all virtual network peerings in a virtual network. + /// Creates or updates a peering in the specified virtual network. /// /// /// The operations group for this extension method. @@ -286,12 +283,19 @@ public static Microsoft.Rest.Azure.IPage List(this IVirtu /// /// The name of the virtual network. /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update virtual network peering + /// operation. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -306,9 +310,9 @@ public static Microsoft.Rest.Azure.IPage List(this IVirtu /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualNetworkPeeringsOperations operations, string nextPageLink) + public static IPage ListNext(this IVirtualNetworkPeeringsOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -323,7 +327,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IV /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IVirtualNetworkPeeringsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IVirtualNetworkPeeringsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -333,3 +337,4 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IV } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperations.cs index b8d0b45621e69..398c0867f0fa1 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// VirtualNetworksOperations operations. /// - internal partial class VirtualNetworksOperations : Microsoft.Rest.IServiceOperations, IVirtualNetworksOperations + internal partial class VirtualNetworksOperations : IServiceOperations, IVirtualNetworksOperations { /// /// Initializes a new instance of the VirtualNetworksOperations class. @@ -29,11 +38,11 @@ internal partial class VirtualNetworksOperations : Microsoft.Rest.IServiceOperat /// internal VirtualNetworksOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -56,16 +65,16 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, virtualNetworkName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// Deletes the specified virtual network. + /// Gets the specified virtual network by resource group. /// /// /// The name of the resource group. @@ -73,83 +82,97 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The name of the virtual network. /// + /// + /// Expands referenced resources. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -166,43 +189,51 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + 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; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,22 +243,40 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets the specified virtual network by resource group. + /// Creates or updates a virtual network in the specified resource group. /// /// /// The name of the resource group. @@ -235,94 +284,99 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The name of the virtual network. /// - /// - /// Expands referenced resources. + /// + /// Parameters supplied to the create or update virtual network operation /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, virtualNetworkName, parameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all virtual networks in a subscription. + /// + /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (virtualNetworkName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualNetworkName", virtualNetworkName); - tracingParameters.Add("expand", expand); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); - } - if (expand != null) + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -339,35 +393,35 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -375,15 +429,15 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -393,7 +447,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -406,7 +460,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -415,141 +469,99 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Creates or updates a virtual network in the specified resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to the create or update virtual network operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, virtualNetworkName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// Creates or updates a virtual network in the specified resource group. + /// Gets all virtual networks in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to the create or update virtual network operation - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (virtualNetworkName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.ApiVersion == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualNetworkName", virtualNetworkName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -565,42 +577,36 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -608,15 +614,15 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -626,7 +632,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -639,7 +645,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -648,105 +654,116 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all virtual networks in a subscription. + /// Checks whether a private IP address is available for use. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The private IP address to be verified. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> CheckIPAddressAvailabilityWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string ipAddress = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.ApiVersion == null) + if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.SubscriptionId == null) + if (virtualNetworkName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("ipAddress", ipAddress); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CheckIPAddressAvailability", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (ipAddress != null) + { + _queryParameters.Add(string.Format("ipAddress={0}", System.Uri.EscapeDataString(ipAddress))); + } + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -763,35 +780,35 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -799,15 +816,15 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -817,7 +834,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -830,7 +847,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -839,96 +856,105 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets all virtual networks in a resource group. + /// Deletes the specified virtual network. /// /// /// The name of the resource group. /// + /// + /// The name of the virtual network. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (virtualNetworkName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + } + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -945,51 +971,43 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 202 && (int)_statusCode != 204 && (int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (Newtonsoft.Json.JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -999,40 +1017,22 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Checks whether a private IP address is available for use. + /// Creates or updates a virtual network in the specified resource group. /// /// /// The name of the resource group. @@ -1040,8 +1040,8 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The name of the virtual network. /// - /// - /// The private IP address to be verified. + /// + /// Parameters supplied to the create or update virtual network operation /// /// /// Headers that will be added to request. @@ -1049,85 +1049,88 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> CheckIPAddressAvailabilityWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string ipAddress = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (virtualNetworkName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetworkName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("ipAddress", ipAddress); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckIPAddressAvailability", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (ipAddress != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("ipAddress={0}", System.Uri.EscapeDataString(ipAddress))); - } - if (this.Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1143,36 +1146,42 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1180,15 +1189,15 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1198,7 +1207,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1211,7 +1220,25 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1220,12 +1247,12 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1242,60 +1269,63 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1312,35 +1342,35 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1348,15 +1378,15 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1366,7 +1396,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1379,7 +1409,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1388,12 +1418,12 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1410,60 +1440,63 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1480,35 +1513,35 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1516,15 +1549,15 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1534,7 +1567,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1547,7 +1580,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1556,15 +1589,16 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperationsExtensions.cs index c869a57ef5452..b57502ff88de6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for VirtualNetworksOperations. @@ -31,7 +35,7 @@ public static partial class VirtualNetworksOperationsExtensions /// public static void Delete(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).DeleteAsync(resourceGroupName, virtualNetworkName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).DeleteAsync(resourceGroupName, virtualNetworkName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -49,48 +53,11 @@ public static void Delete(this IVirtualNetworksOperations operations, string res /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false); } - /// - /// Deletes the specified virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - public static void BeginDelete(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName) - { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false); - } - /// /// Gets the specified virtual network by resource group. /// @@ -108,7 +75,7 @@ public static void BeginDelete(this IVirtualNetworksOperations operations, strin /// public static VirtualNetwork Get(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string expand = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).GetAsync(resourceGroupName, virtualNetworkName, expand), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).GetAsync(resourceGroupName, virtualNetworkName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -129,7 +96,7 @@ public static void BeginDelete(this IVirtualNetworksOperations operations, strin /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, expand, null, cancellationToken).ConfigureAwait(false)) { @@ -154,7 +121,7 @@ public static void BeginDelete(this IVirtualNetworksOperations operations, strin /// public static VirtualNetwork CreateOrUpdate(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -175,7 +142,7 @@ public static VirtualNetwork CreateOrUpdate(this IVirtualNetworksOperations oper /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -184,27 +151,35 @@ public static VirtualNetwork CreateOrUpdate(this IVirtualNetworksOperations oper } /// - /// Creates or updates a virtual network in the specified resource group. + /// Gets all virtual networks in a subscription. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. + public static IPage ListAll(this IVirtualNetworksOperations operations) + { + return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Gets all virtual networks in a subscription. + /// + /// + /// The operations group for this extension method. /// - /// - /// Parameters supplied to the create or update virtual network operation + /// + /// The cancellation token. /// - public static VirtualNetwork BeginCreateOrUpdate(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters) + public static async Task> ListAllAsync(this IVirtualNetworksOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Creates or updates a virtual network in the specified resource group. + /// Gets all virtual networks in a resource group. /// /// /// The operations group for this extension method. @@ -212,53 +187,79 @@ public static VirtualNetwork BeginCreateOrUpdate(this IVirtualNetworksOperations /// /// The name of the resource group. /// - /// - /// The name of the virtual network. + public static IPage List(this IVirtualNetworksOperations operations, string resourceGroupName) + { + return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Gets all virtual networks in a resource group. + /// + /// + /// The operations group for this extension method. /// - /// - /// Parameters supplied to the create or update virtual network operation + /// + /// The name of the resource group. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IVirtualNetworksOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets all virtual networks in a subscription. + /// Checks whether a private IP address is available for use. /// /// /// The operations group for this extension method. /// - public static Microsoft.Rest.Azure.IPage ListAll(this IVirtualNetworksOperations operations) + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The private IP address to be verified. + /// + public static IPAddressAvailabilityResult CheckIPAddressAvailability(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string ipAddress = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).ListAllAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).CheckIPAddressAvailabilityAsync(resourceGroupName, virtualNetworkName, ipAddress), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all virtual networks in a subscription. + /// Checks whether a private IP address is available for use. /// /// /// The operations group for this extension method. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The private IP address to be verified. + /// /// /// The cancellation token. /// - public static async Task> ListAllAsync(this IVirtualNetworksOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CheckIPAddressAvailabilityAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string ipAddress = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CheckIPAddressAvailabilityWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, ipAddress, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets all virtual networks in a resource group. + /// Deletes the specified virtual network. /// /// /// The operations group for this extension method. @@ -266,13 +267,16 @@ public static Microsoft.Rest.Azure.IPage ListAll(this IVirtualNe /// /// The name of the resource group. /// - public static Microsoft.Rest.Azure.IPage List(this IVirtualNetworksOperations operations, string resourceGroupName) + /// + /// The name of the virtual network. + /// + public static void BeginDelete(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).ListAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Gets all virtual networks in a resource group. + /// Deletes the specified virtual network. /// /// /// The operations group for this extension method. @@ -280,19 +284,19 @@ public static Microsoft.Rest.Azure.IPage List(this IVirtualNetwo /// /// The name of the resource group. /// + /// + /// The name of the virtual network. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IVirtualNetworksOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginDeleteAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false); } /// - /// Checks whether a private IP address is available for use. + /// Creates or updates a virtual network in the specified resource group. /// /// /// The operations group for this extension method. @@ -303,16 +307,16 @@ public static Microsoft.Rest.Azure.IPage List(this IVirtualNetwo /// /// The name of the virtual network. /// - /// - /// The private IP address to be verified. + /// + /// Parameters supplied to the create or update virtual network operation /// - public static IPAddressAvailabilityResult CheckIPAddressAvailability(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string ipAddress = default(string)) + public static VirtualNetwork BeginCreateOrUpdate(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).CheckIPAddressAvailabilityAsync(resourceGroupName, virtualNetworkName, ipAddress), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Checks whether a private IP address is available for use. + /// Creates or updates a virtual network in the specified resource group. /// /// /// The operations group for this extension method. @@ -323,15 +327,15 @@ public static Microsoft.Rest.Azure.IPage List(this IVirtualNetwo /// /// The name of the virtual network. /// - /// - /// The private IP address to be verified. + /// + /// Parameters supplied to the create or update virtual network operation /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CheckIPAddressAvailabilityAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string ipAddress = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CheckIPAddressAvailabilityWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, ipAddress, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -346,9 +350,9 @@ public static Microsoft.Rest.Azure.IPage List(this IVirtualNetwo /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListAllNext(this IVirtualNetworksOperations operations, string nextPageLink) + public static IPage ListAllNext(this IVirtualNetworksOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).ListAllNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).ListAllNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -363,7 +367,7 @@ public static Microsoft.Rest.Azure.IPage ListAllNext(this IVirtu /// /// The cancellation token. /// - public static async Task> ListAllNextAsync(this IVirtualNetworksOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAllNextAsync(this IVirtualNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -380,9 +384,9 @@ public static Microsoft.Rest.Azure.IPage ListAllNext(this IVirtu /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualNetworksOperations operations, string nextPageLink) + public static IPage ListNext(this IVirtualNetworksOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// @@ -397,7 +401,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualN /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IVirtualNetworksOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IVirtualNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -407,3 +411,4 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualN } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/generate.cmd b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/generate.cmd index cf2f3722077dc..57db5c1952a71 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/generate.cmd +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/generate.cmd @@ -4,9 +4,9 @@ :: @echo off -set autoRestVersion=0.17.0-Nightly20161002 +set autoRestVersion=1.0.0-Nightly20161206 if "%1" == "" ( - set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-network/2016-06-01/swagger/network.json" + set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-network/2016-09-01/swagger/network.json" ) else ( set specFile="%1" ) From 25a784a5815ba43a81fc42ae16333ac17f3697de Mon Sep 17 00:00:00 2001 From: Deepak Rajendran Date: Wed, 7 Dec 2016 15:53:34 -0800 Subject: [PATCH 5/6] change sdk version --- .../Properties/AssemblyInfo.cs | 4 ++-- .../Network/Microsoft.Azure.Management.Network/project.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Properties/AssemblyInfo.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Properties/AssemblyInfo.cs index b3a90c320a9aa..ca353e044722e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Properties/AssemblyInfo.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Properties/AssemblyInfo.cs @@ -19,8 +19,8 @@ [assembly: AssemblyTitle("Microsoft Azure Network Management Library")] [assembly: AssemblyDescription("Provides Microsoft Azure Network management functions for managing the Microsoft Azure Network service.")] -[assembly: AssemblyVersion("9.0.0.0")] -[assembly: AssemblyFileVersion("9.0.0.0")] +[assembly: AssemblyVersion("8.1.1.0")] +[assembly: AssemblyFileVersion("8.1.1.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/project.json b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/project.json index 3fe93a3c4f9cc..16791c8a6a26f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/project.json +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/project.json @@ -1,5 +1,5 @@ { - "version": "9.0.0-preview", + "version": "8.1.10-preview", "description": "Provides management capabilities for Network services.", "authors": [ "Microsoft" ], From eb2421f232039c856957f15993c4df9aa3233d01 Mon Sep 17 00:00:00 2001 From: Deepak Rajendran Date: Wed, 7 Dec 2016 16:14:39 -0800 Subject: [PATCH 6/6] change sdk version --- .../Network/Microsoft.Azure.Management.Network/project.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/project.json b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/project.json index 16791c8a6a26f..ad74b574849d6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/project.json +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/project.json @@ -1,5 +1,5 @@ { - "version": "8.1.10-preview", + "version": "8.1.1-preview", "description": "Provides management capabilities for Network services.", "authors": [ "Microsoft" ],